html map標籤怎麼用

青灯夜游
發布: 2019-05-27 13:15:12
原創
4079 人瀏覽過

html map標籤用於客戶端映像映射。影像映射指帶有可點選區域的一幅影像。因為html map標籤怎麼用中的 usemap 屬性可引用 中的 id 或 name 屬性(取決於瀏覽器),所以我們要同時向 新增 id 和 name 屬性。

html map標籤怎麼用

html map標籤怎麼用?

作用:定義一個客戶端影像映射。

說明:影像映射(image-map)指帶有可點擊區域的一幅圖像。

註解:area 元素永遠嵌套在 map 元素內部。 area 元素可定義影像映射中的區域。 html map標籤怎麼用中的 usemap 屬性可引用 中的 id 或 name 屬性(取決於瀏覽器),所以我們應同時向 新增 id 和 name 屬性。

html map標籤 範例

<!DOCTYPE html>
<html>
<body>

<img
src="https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg"
border="0" usemap="#planetmap"
alt="Planets" />

<map name="planetmap" id="planetmap">

<area
shape="circle"
coords="180,139,14"
href ="http://www.php.cn/example/html/venus.html"
target ="_blank"
alt="Venus" />

<area
shape="circle"
coords="129,161,10"
href ="http://www.php.cn/example/html/venus.html"
target ="_blank"
alt="Mercury" />

<area
shape="rect"
coords="0,0,110,260"
href ="http://www.php.cn/example/html/venus.html"
target ="_blank"
alt="Sun" />

</map>

<p><b>注释:</b>img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。</p>

</body>
</html>
登入後複製

輸出:

html map標籤怎麼用

以上是html map標籤怎麼用的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!