HTML <area> download属性
実例
クリック可能なダウンロード領域を持つ画像:
<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>
試してみる »
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
現在、Firefox と Chrome のみが download 属性をサポートしています。
定義と使い方
download 属性はダウンロードリンクのアドレスを指定します。
href 属性を使用した場合にのみ、download 属性を指定する必要があります。
この属性はダウンロードファイルの名前も指定できます。ファイル名に制限値はありません。ブラウザは自動的にファイル名の末尾に、そのダウンロードファイルの拡張子(.img、.pdf、.txt、.html など)を追加します。
HTML 4.01 と HTML5 の違い
The download attribute is new for the <area> tag in HTML5.
構文
<area
download="filename">
属性値
| 值 | 説明 |
|---|---|
| filename | ファイル名を指定します。 |
その他の拡張機能
HTML <area> タグ