HTML5 figcaption Tag
The <figurecaption> tag in HTML is used to set a caption to the figure element in a document. The <figcaption>
element can be placed as the first or last child of the <figure> element.
Note: This tag is new in HTML5. The <figcaption>
tag also supports the Global Attributes and Event Attributes in HTML.
Syntax
<figcaption> Figure caption </figcaption>
Example 1: In this example, we will see the implementation of the figcaption tag.
HTML
<!DOCTYPE html> < html > < body > < h1 >w3wiki</ h1 > < h2 > < figcaption Tag> </ h2 > < figure > < img src = "https://media.w3wiki.net/wp-content/uploads/Beginner-25.png" alt = "gfglogo" style = "width:50%" > <!--HTML figcaption tag starts here--> < figcaption > w3wiki Logo </ figcaption > <!--HTML figcaption tag ends here--> </ figure > </ body > </ html > |
Output:
Example 2: In this example, we will see the implementation of the figcaption tag.
HTML
<!DOCTYPE html> < html > < body > < h1 >w3wiki</ h1 > < h2 >< figcaption > Tag</ h2 > < figure > < img src = "https://media.w3wiki.net/wp-content/uploads/w3wiki-20.png" alt = "gfglogo" > <!--HTML figcaption tag starts here--> < figcaption > GFG Logo </ figcaption > <!--HTML figcaption tag ends here--> </ figure > </ body > </ html > |
Output:
Supported Browsers
- Google Chrome 8
- Edge 12 and above
- Firefox 4 and above
- Opera 11 and above
- Safari 5.1 and above
Contact Us