What HTML element is used to define a caption for a <figure>?
Answer
<figcaption>
Answer
<figcaption>
The HTML element used to define a caption for a <figure> is <figcaption>.
The <figure> element groups self-contained content such as an image, diagram, code sample, or illustration. Its accompanying description belongs in <figcaption>, which should be placed inside the figure, usually before or after the featured content. This gives the relationship semantic meaning that browsers, search tools, and assistive technologies can understand.
The pair arrived with HTML5, which standardized several semantic elements, including <figure> and <figcaption>. A common mix-up is <caption>, which is intended for tables, while <legend> labels a <fieldset> in a form. <summary> is associated with the disclosure widget created by <details>.
A figure can contain more than an image: a chart, a quotation, or a short piece of code may also qualify when it is referenced as a separate unit. The caption does not merely style text beneath an image; it identifies and explains the figure structurally.
Source: Wikipedia · fact-checked Aug. 2026