DEV Community

Cover image for HTML tags | figure-figcaption
Carlos Espada
Carlos Espada

Posted on

HTML tags | figure-figcaption

<figure> is used to specify standalone content that may have an occasional caption indicated with <figcaption>. The content type can be a photo, an illustration, a diagram, a quote, a code snippet...

Even if the content is related to the main flow of information, it should be able to move without affecting it. The outline of the <figure> content is excluded from the main outline of the document.

The <figcaption> can be the first or last child of the <figure>. If there is more than one, the first one that appears will be taken into account.

<figure> has an implicit ARIA role figure.

  • Type: block / block
  • Self-closing: No / No
  • Semantic value: Yes / Yes

Definition figure - Definition figcaption | Example figure - Example figcaption | Support figure - Support figcaption

Discussion (0)