HTML5 <figcaption> Tag

Topic: HTML5 Tags Reference« Prev|Next »

Description

The <figcaption> element defines a caption or legend for a figure.

The following table summarizes the usages context and the version history of this tag.

Placement: Block
Content: Block, Inline, and text
Start/End Tag: Start tag: required, End tag: required
Version: New in HTML5

Syntax

The basic syntax of the <figcaption> tag is given with:

HTML / XHTML: <figcaption> ... </figcaption>

The example below shows the <figcaption> tag in action.

  • <figure>
  •     <img src="discovery.jpg" alt="Space Shuttle">
  •     <figcaption>NASA - Space Shuttle Discovery</figcaption>
  • </figure>
 

Note:The only permitted parent element for the <figcaption> element is the <figure> element. The <figcaption> element must be its first or last child.


Tag-Specific Attributes

The <figcaption> tag doesn't have any specific attribute.


Global Attributes

Like all other HTML tags, the <figcaption> tag supports the global attributes in HTML5.


Event Attributes

The <figcaption> tag also supports the event attributes in HTML5.


Browser Compatibility

The <figcaption> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 4+
  • Google Chrome 6+
  • Internet Explorer 9+
  • Apple Safari 5.1+
  • Opera 11.1+

Further Reading

See tutorial on: HTML Images.

Related tags: <figure>, <img>.

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.