<figure> for content with caption

A figure is a unit of content, optionally with a caption.

The figure element can optionally contain a figcaption element. <figcaption> marks a caption for the figure.

 
<!DOCTYPE HTML> 
<html> 
<head> 
<title>Example</title> 
</head> 
<body> 
    <figure> 
    <figcaption>Listing 1. Caption text</figcaption> 
    <p>
       This is the content of the figure. 
       This is the content of the figure.
       This is the content of the figure.
       This is the content of the figure. 
    </p> 
    </figure> 
</body> 
</html>
  
Click to view this demo.

Image with Caption

 
<figure>
<img alt="Bar chart" src="http://java2s.com/Book/HTML-CSSImages/star.png" />
<figcaption>
Website analytics
</figcaption>
</figure>
  

Multiple Images Within figure

 
<figure> 
  <img alt="chart format" src="october.jpg" /> 
  <img alt="chart format" src="november.jpg" /> 
  <img alt="chart format" src="december.jpg" /> 
  <figcaption> 
    website analytics 
  </figcaption> 
</figure>
  
Home 
  HTML CSS Book 
    HTML  

Related: