html area标签怎么用

2022-07-11,,

html area标签用于带有可点击区域的图像映射,area元素总是嵌套在<map>标签中。<img>标签中的usemap属性与map元素name属性相关联,创建图像与映射之间的联系。

html area标签怎么用?

作用:带有可点击区域的图像映射

说明:

<img> 中的 usemap 属性可引用 <map> 中的 id 或 name 属性(由浏览器决定),所以我们需要同时向 <map> 添加 id 和 name 两个属性。

注释:

<area> 标签定义图像映射中的区域(注:图像映射指得是带有可点击区域的图像)。area 元素总是嵌套在 <map> 标签中。<img> 标签中的 usemap 属性与 map 元素 name 属性相关联,创建图像与映射之间的联系。

html area标签 示例

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img src="http://www.php.cn/tpl/Index/Static/img/banner7.jpg" border="0" usemap="#studymap" alt="study" />
<map name="studymap" id="studymap">
    <area shape="circle" coords="180,139,14" href ="http://www.php.cn"  />
    <area shape="circle" coords="129,161,10" href ="http://www.php.cn"  />
    <area shape="rect" coords="0,0,110,260" href ="http://www.php.cn"  />
</map>
</body>
</html>

以上就是html area标签怎么用的详细内容,更多请关注北冥有鱼其它相关文章!

本文转载自【PHP中文网】,希望能给您带来帮助,苟日新、日日新、又日新,生命不息,学习不止。

《html area标签怎么用.doc》

下载本文的Word格式文档,以方便收藏与打印。