首页 技术 正文
技术 2022年11月12日
0 收藏 731 点赞 2,221 浏览 1332 个字

<area>标记:主要用于图像地图,通过该标记可以在图像地图中设定作用区域(又称为热点),这样当用户的鼠标移到指定的作用区域点击时,会自动链接到预先设定好的页面。其基本语法结构如下:

      <area class=”hot” href=”url” alt=”text” shape=”shape” coords=”coords”>

      class和id:是分别指定热点的类型和id号。

      alt:用于设定热点出错时的替换文字。

      href:用于设定该热点所链接的url地址。

      shape和coords:是两个主要的参数,用于设定热点的形状和大小。其基本用法如下:

        <area shape=”rect” coords=”x1, y1,x2,y2″ href=url>表示设定热点的形状为矩形,左上角顶点坐标为(x1,y1),右下角顶点坐标为(x2,y2)。

        <area shape=”circle” coords=”x1, y1,r” href=url>表示设定热点的形状为圆形,圆心坐标为(x1,y1),半径为r。

        <area shape=”poligon” coords=”x1, y1,x2,y2 ……” href=url>表示设定热点的形状为多边形,各顶点坐标依次为(x1,y1)、(x2,y2)、(x3,y3) ……。

          备注:x1, y1,x2,y2 这几个点的位置 是根据图片而定的,不是根据窗口的大小而定。 

          <area>标记是在图像地图中划分作用区域的,因此其划分的作用区域必须在图像地图的区域内,所以在用 <area>
标记划分区域前必须用HTML的另一个标记<map>来设定图像地图的作用区域,并为指定的图像地图设定名称,该标记的用法很简单,即<map
name=”图像地图名称”> …… </map>。

  

      代码展示:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{margin:0px;padding:0px;}
.wrap{width:736px;height:400px;border:2px solid red;margin:100px auto;}
</style>
</head>
<body>
<div class="wrap">
<img src="1.jpg" width="736" height="400" usemap="#planetmap">
<map name="planetmap" id="planetmap">
<area class="area1" shape="circle" coords="100,100,100" href="http://www.baidu.com" rel="external nofollow" target="_blank"/>
<area class="area2" shape="rect" coords="300,200,700,400" href="http://www.wujiaw.com" rel="external nofollow" target="_blank"/>
</map>
</div>
</body>
</html>

area热点区域

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,955
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,479
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,291
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,108
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,740
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,774