The figure element is used to contain an independent piece of content. If the content is removed, it will not affect the surrounding content. Specifically, it can be used to represent pictures, statistical charts, charts, audio, video, code snippets, etc. If necessary, you can also add a title to the content. This title is represented by figcaption. figcaption can only be used as a child element of the figure element and can be placed anywhere within the figure element. In the form:
<figure><img src="" alt="" /><figcaption>博客园</figcaption></figure>
Not all pictures are wrapped in figures, and the img tag also has semantics. If the figure is purely for presentation and will not be referenced elsewhere in the document, then absolutely do not use figure. If it is related to the context, you can also move it to the appendix, then don't use figure, aside may be suitable.
The figure element and the aside element seem to express similar content, but aside can contain a wider range of content than figure. When you don’t know how to choose, you can do it like this: this content is a key point, or very important, and indispensable to the surrounding content, then you can use figure, otherwise use aside.
Note:
Only one figcaption element is allowed to be placed in a figure element, or not, but other elements can be placed unlimitedly. Note that not all images need to use the figure element.
HTML figure tag