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="images/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>

 

你可能感兴趣的:(html)