HTML <img> แอตทริบิวต์usemap
ตัวอย่าง
แผนผังรูปภาพพร้อมพื้นที่ที่สามารถคลิกได้:
<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400"
height="379">
<map name="workmap">
<area shape="rect"
coords="34,44,270,350" alt="Computer" href="computer.htm">
<area
shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">
</map>
ความหมายและการใช้งาน
แอตทริบิวต์usemap
ระบุรูปภาพเป็นแผนผังรูปภาพฝั่งไคลเอ็นต์ (แผนผังรูปภาพคือรูปภาพที่มีพื้นที่คลิกได้)
แอตทริบิวต์usemap
เชื่อมโยงกับ แอตทริบิวต์ชื่อองค์ประกอบ และสร้าง ความ<map>
สัมพันธ์ระหว่าง
<img>
และ
<map>
หมายเหตุ:usemap
ไม่สามารถใช้แอตทริบิวต์ได้หากองค์ประกอบ
<img>
นั้นเป็นลูกหลานขององค์ประกอบ<a>
หรือ
<button>
รองรับเบราว์เซอร์
Attribute | |||||
---|---|---|---|---|---|
usemap | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
<img usemap="#mapname">
ค่าแอตทริบิวต์
Value | Description |
---|---|
#mapname | A hash character ("#") plus the name of the <map> element to use |
❮ แท็ก HTML <img>