HTML - How can I add a caption under an image?
HTML5 offers a great tag <figure> to make life easy for web developers.
Say you have a couple of images and would like to add a caption under each image, we can use <figure> tag to accomplish this easily.
<center>
<a href="#">
<figure>
<img src="images/linux.jpg" alt='alt text'>
<figcaption>My Caption one</figcaption>
</figure>
</a>
<a href="#">
<figure>
<img src="images/linux.png" alt='alt text'>
<figcaption>My Caption two</figcaption>
</figure>
</a>
</center>
The above code will look like the following text in the browser:.