Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to set caption for an image using HTML ?

  • Last Updated : 30 Sep, 2020

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:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!