HTML a shape 屬性
實例
在<a> 元素中使用shape 和coords 創建圖像地圖:
<object data="planets.gif" alt="Planets" type="image/gif" usemap="#Map1">
<map name="Map1">
<a href="sun.htm" shape="rect" coords="0,0,82,126">太阳</a>
<a href="mercur.htm"shape="circle" coords="90,58,3">水星</a>
<a href="venus.htm" shape="circle" coords="124,58,8">金星</a>
</map>
</object>
<map name="Map1">
<a href="sun.htm" shape="rect" coords="0,0,82,126">太阳</a>
<a href="mercur.htm"shape="circle" coords="90,58,3">水星</a>
<a href="venus.htm" shape="circle" coords="124,58,8">金星</a>
</map>
</object>
嘗試一下»
瀏覽器支持
目前只有Firefox 和Opera 支持shape 屬性。
定義和用法
HTML5不再支持<a>標籤的shape屬性。
shape屬性與coords屬性配合,可以規定<object>或<img>元素中鏈接的尺寸、形狀和位置。
提示: :如需創建能夠在所有瀏覽器中運行的圖像映射,請使用<area>元素!
語法
<a shape="value">
屬性值
值 | 描述 |
---|---|
default | 規定全部區域。 |
rect | 定義矩形區域。 |
circle | 定義圓形。 |
poly | 定義多邊形區域。 |