web:html:media

HTML - médias

L'insertion d'image peut se faire avec la balise auto-fermante img :

<img src="images/chaton.webp" alt="Un chaton"/>

L'attribut alt doit être présent pour fournir un texte alternatif à l'image.

<img src="images/dinosaur.jpg"
     alt="The head and torso of a dinosaur skeleton;
          it has a large head with long sharp teeth">

Le texte alternatif est utile :

  • Si l'image n'est pas chargée (introuvable ou désactivée par l'internaute),
  • pour le référencement,
  • pour faciliter la navigation des personnes mal voyantes.

La propriété title permet d'afficher une infobulle au survol de l'image par la souris.

<figure>
  <img src="images/dinosaur.jpg"
        alt="The head and torso of a dinosaur skeleton;
            it has a large head with long sharp teeth"
        width="400"
        height="341">

  <figcaption>A T-Rex on display in the Manchester University Museum.</figcaption>
</figure>
The head and torso of a dinosaur skeleton;
            it has a large head with long sharp teeth
A T-Rex on display in the Manchester University Museum.

Inégrer des images adaptatives

  • web/html/media.txt
  • Dernière modification : il y a 14 mois
  • de jcheron