Open In App

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.




<!DOCTYPE html>
<html>
 
<body>
 
    <h1>GeeksforGeeks</h1>
    <h2>
        <figcaption Tag>
    </h2>
    <figure>
        <img src=
             alt="gfglogo" style="width:50%">
       
        <!--HTML figcaption tag starts here-->
       
        <figcaption>
            GeeksforGeeks 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.




<!DOCTYPE html>
 
<html>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2><figcaption> Tag</h2>
    <figure>
        <img src=
             alt="gfglogo">
       
        <!--HTML figcaption tag starts here-->
       
        <figcaption>
            GFG Logo
        </figcaption>
       
        <!--HTML figcaption tag ends here-->
       
    </figure>
</body>
 
</html>

Output: 

Supported Browsers


Article Tags :