shape 属性指定区域的形状,shape 属性与 coords 属性配合,以指定区域的大小,形状和位置。
在线示例
具有可点击区域的图像地图:
<!DOCTYPE html> <html> <title>HTML:<area> shape 属性 - 大卫编程网 div.cn</title> <body> <p>单击太阳或其他行星以近距离观察它:</p> <img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" href="/tags/sun.html" alt="Sun"> <area shape="circle" coords="90,58,3" href="/tags/mercur.html" alt="Mercury"> <area shape="circle" coords="124,58,8" href="/tags/venus.html" alt="Venus"> </map> </body> </html>测试看看 ‹/›
浏览器兼容性
IEFirefoxOperaChromeSafari
所有主流浏览器都支持 shape 属性
定义和用法
shape 属性指定区域的形状。
shape 属性与 coords 属性配合,以指定区域的大小,形状和位置。
HTML 4.01 与 HTML5之间的差异
无.
语法
<area shape="default|rect|circle|poly">
属性值
值 | 描述 |
---|---|
default | 规定全部区域。 |
rect | 定义矩形区域。 |
circle | 定义圆形。 |
poly | 定义多边形区域。 |