Loading...
Loading...
00:00:00

<figure>, <img> and <figcaption> Tags in HTML5

he <figure>, <figcaption>, and <img> tags in HTML5 are used to create figures and images in web pages.

The <figure> tag is used to create a container for images, diagrams, code snippets, and other types of content that can be considered a self-contained unit. The <figure> tag provides a way to associate a caption or legend with the content inside the figure, using the <figcaption> tag.

<figure>
    <img src="http://site.com/logo.png" alt="logo image">
    <figcaption> This is logo </figcaption>                
</figure>

The <figcaption> tag is used to provide a caption or legend for the content inside the <figure> tag. The caption provides additional information or context for the content, making it easier to understand.

The <img> tag is used to embed images in an HTML document. The <img> tag has several attributes, including src, which specifies the URL of the image, alt, which provides alternative text for the image, and width and height, which control the size of the image.

By using these elements, you can provide more structured and meaningful information about the images and figures in your web pages, making it easier for users to understand and interact with the content. Additionally, the <figure> and <figcaption> tags provide a semantic way to associate captions with images and other types of content, which can be useful for accessibility purposes.