Marc Bouvier (Baldir)

Développeur logiciel en quête du sens dans un monde aux ressources limitées.

Texte alternatif d’une image dans une figure

Notes

Faut-il mettre le texte alternatif d’une image dans une figure avec une figcaption ?

Exemple de w3s:

<figure>
  <img src="pic_trulli.jpg" alt="Trulli" style="width:100%">
  <figcaption>Fig.1 - Trulli, Puglia, Italy.</figcaption>
</figure>

I'm a blind user. I would say that there are two big categories of images on the web:

AS the name says, figcaption is a caption for a figure. The caption is always visible by everybody, not only blind people. Figures are images that can be found in a book, an article, or whatever more or less long paragraphs of text. Most of the time, figures are purely illustrative.

When you use figcaption, the alt attribute should probably be empty:

Now, the biggest case when you won't use figure/figcaption is when images are functional: a button taht can be clicked, an icon with a precise meaning, etc. The basic rules for alt texts of functional images are:

— QuentinC https://stackoverflow.com/a/58468470/444769