A <figure>
tag is used to show contents like images, illustrations,
code snippets, text etc.
But then why to use <figure>
tag instead of using tags like <img>
. Let's
look at an example of a Image:
The contents of a <figure>
element i.e. the image as well as the caption below
in this case, all of these are considered as a single unit and independent of
the main content.
That means, even if we move the figure element away from the main flow of the
document it should not affect the meaning of the document.
Another example could be a Quotation: