HTML figcaption tag <figcaption> is used to classify a caption for an element of HTML figure type.
In other words we can say that, whenever we want to provide caption to HTML Figure type we use the HTML figcaption tag.
HTML figcaption tag should be either first or last child of the HTML Figure tag.
HTML 5 figcaption tag is a closed tag and needs closing figcaption HTML 5 tag </figcaption>.
Note: Figcaption tag is new in HTML 5.
HTML Figcaption Tag Syntax
<figcaption> Some caption for figure here.. </figcaption>
HTML Figcaption Tag Example
|HTML Figcaption Tag Code||Output|
Earth is the third planet from the Sun, and fifth-largest of the eight planets in the Solar System. It is sometimes referred to as the world or the Blue Planet. <figure> <img alt="The Earth" src="Earth.jpg" width="304" height="228" /> <figcaption> Blue Planet: The Earth </figcaption> </figure>
|Earth is the third planet from the Sun, and fifth-largest of the eight planets in the Solar System. It is sometimes referred to as the world or the Blue Planet.
Here in the above figcaption HTML example we can see that the text “Blue Planet: The Earth” becomes the caption for the image of the earth.
Also note that we have used the figcaption tag within the HTML figure tag.
HTML 5 Figcaption tag supports all HTML Global Attributes and HTML Event Attributes.
HTML Figcaption Tag Supporting Browsers
|1||Internet Explorer||Yes (From IE 9 Onwards)|