HTML figcaption tag

HMTL <figcaption> tag specifies a caption or a title for the content of the <figure> element.

Example

<figure>
  <img src="files/web.png" height="400px" width="400px" />
  <figcaption>Logo of codingb</figcaption>
 </figure>

Try </>

Specific uses

figcaption element may be used for flow type content. For instance,

  • table
  • image
  • video

table

The figcaption defines a title for the table in this example.

Example

MonthExpenses
January $30000
Febuary $40000
March $25000
April $32000
May $28000
Total $155000
Table of monthly expenses
Try </>

image

The figcaption element specifies a caption or title for an image in this example. 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</>

Tag omission

Both opeing and closing tags are necessary for the figcaption element.

Global Attributes

All the global attributes support the figcaption element.



Was this article helpful?

 

Email:

Message:

Get the newsletter