Html中的area元素的屬性應用範例

屬性:shape=""

rectangle / rect 矩形:支持4個座標

polygon / poly 多邊形:支持10個座標

circle / circ 圓形:支持3個座標

 

屬性:coords=""<!--座標1,座標2,座標3-->

 

屬性:href=""<!--跳轉頁面-->

 

範例:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Creating an Image Map</title>
</head>
<body>
<p>
<img src="p_w_picpaths/gallery_map.gif" alt="Gallery Map" width="500" height="300" border="0" usemap="#gallery" />
<map name="gallery">
<area shape="circle" coords="154,150,59" href="foyer.html" target="_self" alt="Gallery foyer">
<area shape="poly" coords="270,79,351,79,351,15,486,15,486,218,272,218,292,166,292,136,270,76" href="sculpture_garden.html" target="_self" alt="Sculpture garden">
<area shape="rect" coords="325,224,488,286" href="workshops.html" target="_self" alt="Artists studios">
</map>
</p>
</body>
</html>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章