سمة استخدام HTML <img >

❮ علامة HTML <img>

مثال

خريطة صورة مع مناطق قابلة للنقر:

<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>