This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
English
Images
- Show a picture with the
<img>tag. <img>is a single tag — no closing tag, like<br>.- It needs two attributes:
src(where the picture is) andalt(a description).
Français
Images
- Affichez une image avec la balise
<img>. <img>est une balise unique — sans balise de fermeture, comme<br>.- Elle a besoin de deux attributs :
src(où se trouve l'image) etalt(une description).
<img src="/static/code/web-basics/cat.svg" alt="A cartoon cat">
English
Why alt text matters
altis text that describes the picture.- It shows if the image cannot load, and screen readers read it aloud.
- Always add a short, clear
alt— it makes your page kinder to everyone.
Français
Pourquoi le texte alternatif est important
altest un texte qui décrit l'image.- Il s'affiche si l'image ne peut pas se charger, et les lecteurs d'écran le lisent à voix haute.
- Ajoutez toujours un
altcourt et clair — cela rend votre page plus accessible pour tous.
English
Common mistakes
- An image needs
src(the file) andalt(a description). <img>has no separate closing tag.
Français
Erreurs courantes
- Une image a besoin de
src(le fichier) et dealt(une description). <img>n'a pas de balise de fermeture séparée.
English
Now you try
- The picture lives at
/static/code/web-basics/cat.svg. - Show it, then add
alttext to an image.
Français
À vous maintenant
- L'image vit à
/static/code/web-basics/cat.svg. - Montrez-la, puis ajoutez un texte
altà une image.
Show the cat picture. Add an <img> with src="/static/code/web-basics/cat.svg". · Affichez l'image du chat. Ajoutez une balise <img> avec src="/static/code/web-basics/cat.svg".
This image has no description. Add an alt attribute that describes it, like alt="A cartoon cat". · Cette image n'a pas de description. Ajoutez un attribut alt qui la décrit, comme alt="A cartoon cat".