I am an advanced developer stuck with a simple question.
Is the position of a
<figure> element on a webpage Important or not?
And what are some good use-cases of the figure element?
Generally, they say a
<figure> element is used for photos, codeblock, diagrams, etc. While the content of the element is related to the main flow, its position is independent of the main flow, and if removed it should not affect the flow of the document.
According to these articles from Pluralsight:
<figure> if the content is essential, but it's exact position on the page is important.
When I look at the article from html.com:
<figure> is for content directly related to the main content, while
<aside> is for “tangentially related” content.
- Contains self-contained content (content with meaning on itself).
- It can be removed and would not affect an article for example.
- It is only used for content directly related to the main content.
- The position within a article is important.
Please explain me why and when I should wrap my
<img> inside a
<figure> when a
<figcaption> isn't needed.