首页> 基础笔记 >HTML5基础学习 HTML5基础学习

map地图标签 HTML5学习笔记(十一)

作者:小萝卜 2019-07-28 浏览 1107

简介定义一个客户端图像映射。图像映射(image-map)指带有可点击区域的一幅图像。

代码结构:

< img src="planets.jpg" border="0" usemap="#planetmap" alt="Planets" />

< map name="planetmap" id="planetmap">
  < area shape="circle" coords="180,139,14" href ="venus.html" alt="Venus" />
  < area shape="circle" coords="129,161,10" href ="mercur.html" alt="Mercury" />
  < area shape="rect" coords="0,0,110,260" href ="sun.html" alt="Sun" />
< /map>

定义一个客户端图像映射。图像映射(image-map)指带有可点击区域的一幅图像。

注释:< img>中的 usemap 属性可引用 < map> 中的 id 或 name 属性(取决于浏览器),所以我们应同时向 < map> 添加 id 和 name 属性。

 

 

很赞哦! (0)

文章评论

    高端网站建设