HTML5 | figure Tag

The <figure> tag in HTML is used to add self-contained content like illustrations, diagrams, photos or codes listing in a document. It is related to main flow but it can be used in any position of a document and the figure goes with the flow of the document and if remove it then it should not affect the flow of the document. This tag is new in HTML5.

Syntax:

<figure> Image content... </figure>

Attributes: It contains mostly two tags which are listed below:

  • img src: This tag is used to add image source in the document.
  • figcaption: This tag is use to set the caption to the image.

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>figure tag</title>
        <style>
            body {
                text-align:center;
            }
            h1 {
                color:green;
            }
        </style>
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2><figure> Tag</h2>
        <figure>
            <img src=
            alt="The Pulpit Rock" width="304" height="228">
            <figcaption>Geeks logo</figcaption>
        </figure>
    </body>
</html>                    

chevron_right


Output:

Supported Browsers: The browser supported by <figure> tag are listed below:

  • Google Chrome 6.0
  • Edge 9.0
  • Firefox 4.0
  • Safari 5.0
  • Opera 11.1


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.