HTML <area> downloadAttributs
Exemple
Une image avec une zone de téléchargement cliquable :
<img src="planets.gif.html" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="information_about_the_sun.htm.html" download="sun">
<area shape="circle" coords="90,58,3" alt="Mercury" href="merglobe.gif.html" download="mercury">
<area shape="circle" coords="124,58,8" alt="Venus" href="information_about_the_planet_venus.txt.html" download="venus">
</map>
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="information_about_the_sun.htm.html" download="sun">
<area shape="circle" coords="90,58,3" alt="Mercury" href="merglobe.gif.html" download="mercury">
<area shape="circle" coords="124,58,8" alt="Venus" href="information_about_the_planet_venus.txt.html" download="venus">
</map>
Essayez-le vous-même »
Prise en charge des navigateurs
![]()
![]()
![]()
![]()
![]()
Actuellement, seuls Firefox et Chrome prennent en charge l'attribut download.
Définition et utilisation
L'attribut download spécifie l'adresse du lien de téléchargement.
Vous n'avez besoin de spécifier l'attribut download que lorsque l'attribut href est utilisé.
Cet attribut peut également spécifier le nom du fichier téléchargé. Il n'y a aucune valeur restreinte pour le nom de fichier ; le navigateur ajoutera automatiquement l'extension du fichier téléchargé (.img, .pdf, .txt, .html, etc.) à la fin du nom de fichier.
Différences entre HTML 4.01 et HTML5
L'attribut download est nouveau pour la balise <area> en HTML5.
Syntaxe
<area
download="filename">
Valeurs d'attributs
| Valeur | Description |
|---|---|
| filename | Spécifie le nom du fichier. |
Autres extensions
Balise HTML <area>