HTML <figcaption> Tag

The <figcaption> element is used to add a caption for <figure> element.

You can locate <figcaption> tag as the first or last child of its parent <figure> element.

Only one <figcaption> tag may be nested within a <figure>, although the <figure> tag itself may contain multiple other child elements (e.g., <img> or <code>).

Syntax

The <figcaption> tag comes in pairs. The content must be written between opening (<figcaption>) and closing (</figcaption>) tags.

Example

<!DOCTYPE html>
<html>
   <body>
      <h2>A cute baby</h2>
      <figure>
         <img src="/uploads/media/default/0001/01/25acddb3da54207bc6beb5838f65f022feaa81d7.jpeg" alt="A Cute Baby" width="250" height="200">
         <figcaption>Fig.1 - A cute Armenian baby.</figcaption>
      </figure>
   </body>
</html>

Result


The <figcaption> tag uses the Global Attributes.