例子
带有可点击区域的图像地图:
<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>
下面有更多“自己尝试”的示例。
定义和用法:
该<area>标签定义了图像地图内的区域(图像地图是具有可点击区域的图像)。
<area>元素总是嵌套在<map>标签内。
注意:usemap中的属性与元素的属性<img>相关联,并创建图像和地图之间的关系,<map> name。
浏览器支持

全局属性
该<area>标签支持HTML中的全局属性。
事件属性
该<area>标签支持HTML中的事件属性。
例子:
另一个带有可点击区域的图像地图:
<img src="planets.gif" width="145" height="126" alt="Planets"
usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
</map>
默认CSS设置:
<area>大多数浏览器将使用以下默认值显示该元素:
area {
display: none;
}
HTML中<area>标签的使用与特性
610

被折叠的 条评论
为什么被折叠?



