<figure> Tag in HTML

The <figure> tag is used to encapsulate content such as images, illustrations, diagrams, or other media that are referenced in the content of the page. It is often used together with the <figcaption> tag to provide a caption for the media.

Key Points on <figure> Tag:

Syntax of <figure> Tag:

Syntax Example

<figure>
            <img src="image.jpg" alt="Description of image">
            <figcaption>This is an image description</figcaption>
        </figure>

Example of <figure> Tag in HTML:

This example demonstrates how to use the <figure> tag to encapsulate an image and its caption using the <figcaption> tag.

Code Example



<figure>
    <img src="B1.jpg" alt="A beautiful butterfly">
    <figcaption>This is a beautiful butterfly having multiple colours.</figcaption>
</figure>
        

Output

A beautiful butterfly
This is a beautiful butterfly having multiple colours.

The <figure> tag helps in organizing media content along with a caption. It is particularly helpful in ensuring that media content such as images and videos are semantically grouped with their descriptions, making your content more accessible and search-engine-friendly.