html图像映射img map area

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值