DEV Community


Discussion on: Why you should never ignore the alt attribute

rokuem profile image
Mateus Amorim

And for captions, we can use the HTML tag

  <img src="someimg.jpg" alt="some alt text">
  <figcaption>Some description</figcaption>

Depending on your html structure and the importance of the caption, you may also do it like this:

<img src="assets/someImg.jpg" alt="" aria-described-by="description">
<p id="description" >