How to set caption for an image using HTML ?
The <figurecaption> tag in HTML is used to set a caption to the figure element in a document. This tag is new in HTML5.
Syntax:
<figcaption> Figure caption... </figcaption>
Example 1:
HTML
<!DOCTYPE html><html> <head> <style> body { text-align: center; } h1 { color: green; } </style></head> <body> <h1>GeeksforGeeks</h1> <h3> How to define an image caption? </h3> <figure> <img src= alt="gfglogo" style="width:50%"> <figcaption>GeeksforGeeks Logo</figcaption> </figure></body> </html> |
Output:


