HTML figure - how to use <figure> tag

The HTML <figure> tag is used to define self contained content like photos, code listing, etc. The figure tag is introduced in HTML5.

The <figcaption> tag is usually used to display a caption for the figure.

Attributes

The figure tag supports the global and event attributes.

Examples:

<!--figure tag with image--> <figure> <img src="html.jpg" alt="HTML" style="width:304; height:228; border:0;"> </figure> <!--figure tag with content--> <figure> <p> This is a test<br/> This is a re test<br/> This is a re re test<br/> </p> <figcaption> <cite>Test</cite>. By: Test Test </figcaption> </figure>