1.img 属性 src alt
eg: <img src="url" alt="some_text">
url:图片地址链接。alt :预备可替换文本(用于图片加载较慢,或者防止图片出错时加载文字出来)。
一个简单的图像映射的例子:点击上方图片位置,在下方iframe框中显示对应小图片
<html>
<head>
<title>图像映射练习</title>
<meta charset="utf-8">
</head>
<body>
<img src="images/cc_0009.png " width="512px" height="512px" alt="one" usemap="two">
<map name="two">
<area shape="rect" coords="39px,68px,179px,202px" alt="two" href="images/cc_0000.png" target="iframe_a">
<area shape="rect" coords="179px,68px,328px,202px" alt="three" href="images/cc_0001.png" target="iframe_a">
<area shape="rect" coords="328px,68px,468,202px" alt="four" href="images/cc_0002.png" target="iframe_a">
<area shape="rect" coords="39px,202px,179px,350px" alt="five" href="images/cc_0003.png" target="iframe_a">
<area shape="rect" coords="179px,202px,328x,350px" alt="six" href="images/cc_0004.png" target="iframe_a">
<area shape="rect" coords="328px,202px,468px,350px" alt="seven" href="images/cc_0005.png" target="iframe_a">
<area shape="rect" coords="39px,350px,179px,500px" alt="eight" href="images/cc_0006.png" target="iframe_a">
<area shape="rect" coords="179px,350px,328px,500px" alt="nine" href="images/cc_0007.png" target="iframe_a">
<area shape="rect" coords="328px,350px,468px,500px" alt="nine" href="images/cc_0008.png" target="iframe_a">
</map>
<p> 我不菜呀,我只是技术差那么一点点</p>
<iframe src="images/cc_0000.png " name="iframe_a"style="margin-left: 50px">
</iframe>
</body>
</html>
shape(形状):rect (矩形)circle(圆形) 多边形(poly)
coords 坐标:rect(x1,y1,x2,y2)左上坐标x1,y1,右下坐x2,y2. circle(x,y,radius) 原点坐标半径 poly(x1,y1,x2,y2...xn,yn)
target :控制href 链接显示到哪里,其他属性:_blank 显示到一个新的页面
代码和图片压缩包链接:
https://pan.baidu.com/s/1-6GX6zNUxodhSWzSMjcqSA