HTML <figcaption> tag
The <figcaption> tag is used to define a caption within the <figure> element.
It may assign as a first or last child for the figure element.
Type: Block Element
Syntax of <figcaption> tag
<figure> <img src="image.jpg" alt="Description"> <figcaption> Caption </figcaption> </figure>
Supported Browsers
| Tag | Chrome | Internet Explorer | Firefox | Safari | Opera Mini |
|---|---|---|---|---|---|
| <figcaption> | 6.0 or higher | 9.0 or higher | 4.0 or higher | 5.0 or higher | 11.1 or higher |
Full code example
<!DOCTYPE html> <html> <head> </head> <body> <figure> <img src="bala.jpg" height="200px" width="200px"> <figcaption> <i> Fig. 1 </i> Bala Hijam </figcaption> </figure> </body> </html>
Output on the browser
More reference
The <figcaption> tag must be defined only inside the <figure> element; otherwise, it may be invalid. Its content must be directly related to the corresponding <figure> element. Only one <figcaption> tag should be defined for each <figure> element.
Default CSS property of <figcaption> tag
figcaption { display: block; }
