HTML5 <figcaption>
Tag
Topic: HTML5 Tags ReferencePrev|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:
The example below shows the <figcaption>
tag in action.
Example
Try this code »<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.
Basic Support—
|
Further Reading
See tutorial on: HTML Images.