The figure tag (<figure>) is used to mark up one or more images in a HTML5 document. The figure element specifies a self-contained content which is independent from the main flow of the document. So if it is removed then there is no effect in the output as well as the flow of the document.

Important point need to be remembered:

  • HTML5 figure element is supported by latest versions of all web browsers. Internet Explorer 8 or earlier versions of Internet Explorer do not support figure element.

There are some HTML5 figure element examples given below:

The figure tag with an image

<figure>
    <img src="sunrise.jpg" alt="The photo of Sunrise" width="400" height="300">
</figure>

The figure tag with multiple images

<figure>
    <img src="sunset.jpg" alt="The photo of Sunset" width="400" height="300">
    <img src="sunrise.jpg" alt="The photo of Sunrise" width="400" height="300">
</figure>

S Ghosh

Leave a Reply

Your email address will not be published. Required fields are marked *