The HTML figure tag is used for adding self-contained content such as illustrations, photos, diagrams, or code listings. HTML figure tag contains two tags such img src and figcaption. Img src is used for adding image source in a document; while figcaption is used for setting caption to an image.