What is the <figure> element in HTML?

The <figure> element in HTMLHypertext Markup Language is referred to as a self-contained, single content block. We can keep code snippets, illustrations, diagrams, pictures, etc., together in a single tag. It helps to easily add or remove content without any errors.

Syntax

Content, tags, or headings should be enclosed between opening and closing tags.

<figure> ....... </figure>

Attributes

This tag supports both global and event attributes. CSS can be used to make the content responsive in the figure element.

<figure> Tag Supported Browsers

Code

In the code snippet, the <figure> tag is being used from line 12 to line 15 which contain the <img> and <figcaption> elements. The final output contains an Educative logo and its caption at the bottom.

  • HTML

Free Resources