HTML <area> coords 属性
示例
使用 coords 属性为图像映射中的每个区域指定坐标
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="sun.htm" alt="太阳">
<area shape="circle" coords="90,58,3" href="mercur.htm" alt="水星">
<area shape="circle" coords="124,58,8" href="venus.htm" alt="金星">
</map>
自己动手试一试 »
定义和用法
coords
属性指定了图像映射中区域的坐标。
coords
属性与 shape
属性一起使用,用于指定区域的大小、形状和位置。
提示:区域左上角的坐标为 0,0。
浏览器支持
Attribute | |||||
---|---|---|---|---|---|
coords | 是 | 是 | 是 | 是 | 是 |
语法
<area coords="值">
属性值
值 | 描述 |
---|---|
x1,y1,x2,y2 | 指定矩形(shape="rect")的左上角和右下角坐标 |
x,y,radius | 指定圆心坐标和半径(shape="circle") |
x1,y1,x2,y2,..,xn,yn | 指定多边形各边的坐标。如果第一个和最后一个坐标对不相同,浏览器将添加最后一个坐标对来闭合多边形(shape="poly") |
❮ HTML <area> 标签