<div role="figure" aria-labelledby="caption">
<img src="image.png" alt="put image description here" />
<p id="caption">Figure 1: The caption</p>
</div>ARIA: figure role / notebook
ARIA: figure role
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<div role="figure" aria-labelledby="figure-1">
…
<p id="figure-1">Text that describes the figure.</p>
</div><figure>
<img src="image.png" alt="put image description here" />
<figcaption>Figure 1: The caption</figcaption>
</figure><div role="figure" aria-labelledby="figure-1">
<img
src="diagram.png"
alt="diagram showing the four layers of awesome and their relative priority order —
music, cats, nature, and ice cream" />
<pre>
`
let awesome = ['music', 'cats', 'nature', 'ice cream'];
`</pre>
<p id="figure-1">Figure 1: The four layers of awesome.</p>
</div><figure>
<img
src="diagram.png"
alt="diagram showing the four layers of awesome and their relative priority order —
music, cats, nature, and ice cream" />
<pre>
`
let awesome = ['music', 'cats', 'nature', 'ice cream'];
`</pre>
<figcaption>Figure 1: The four layers of awesome.</figcaption>
</figure>