HTML figure tag

<figure> tag contains flow contents like images, diagrams with some description or title.

<figure> element contains child <figcaption> element in which we write the title for the related diagram.

Example

<figure>
  <img src="files/logo.png" width="300px" height="300px">
  <figcaption>Learn HTML-codingb</figcaption>
 </figure>
Try </>

Specific Uses

figure element can be used for the flow type content. For instance,

  • table

  • image

  • video

table

The figure element can be used for the table in this example.

Example

JuneExpenses
July $35000
August $40000
September $21000
October $22000
November $20000
December $138000
Table of monthly expenses
Try </>

image

The figure element can be used for an image. As you can see the top most example.

video

The figcaption element defines a caption or title for the section element in this example.

Example

<figure>
 <video src="files/Hummingbird.mp4" style="width:300px; height:300px;" controls>
 </video>
 <figcaption>Video demo</figcaption>
</figure>

Try</>

Global Attributes

All the global attributes are applicable on the figure element.

Tag omission

Both opening and closing tags are necessary on the figure element.



Was this article helpful?

 

Email:

Message:

Get the newsletter