Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

How to specify self-contained content using HTML ?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The <figure> tag in HTML is used to add self-contained content like illustrations, diagrams, photos or codes listing in a document. It is related to main flow but it can be used in any position of a document and the figure goes with the flow of the document and if remove it then it should not affect the flow of the document. This tag is new in HTML5.


<figure> Image content... </figure>

Attributes: It contains mostly two attributes which are listed below:

  • img src: It is used to add image source in the document.
  • figcaption: It is used to set the caption to the image.



<!DOCTYPE html>
        How to specify self-contained
        content using HTML?
        body {
            text-align: center;
        h1 {
            color: green;
        How to specify self-contained
        content using HTML?
        <img src=
        alt="Geeks" width="304"
        <figcaption>Geeks logo</figcaption>


Supported Browsers:

  • Google Chrome 6.0
  • Edge 9.0
  • Firefox 4.0
  • Safari 5.0
  • Opera 11.1

My Personal Notes arrow_drop_up
Last Updated : 22 Dec, 2020
Like Article
Save Article
Similar Reads
Related Tutorials