Open In App

How to set caption for an image using HTML ?

Improve
Improve
Like Article
Like
Save
Share
Report

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:


Last Updated : 30 Sep, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads