HTML 参考手册

HTML 标签大全

HTML: <area> shape 属性

shape 属性指定区域的形状,shape 属性与 coords 属性配合,以指定区域的大小,形状和位置。

 HTML <area> 标签

在线示例

具有可点击区域的图像地图:

<!DOCTYPE html>
<html>
<title>HTML:<area> shape 属性 - 菜鸟教程 (cainiaojc.com)</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="sun.html" alt="Sun">
  <area shape="circle" coords="90,58,3" href="mercur.html" alt="Mercury">
  <area shape="circle" coords="124,58,8" href="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定义多边形区域。

 HTML <area> 标签