HTML元素 - map的用法

news/2024/7/8 5:37:35 标签: html, image, 图形, 文档
htmledit_views">  

在Html中,给图像使用map标签,可以给图像的某个部分建立超连接,用法如下:

<img src=img.gif usemap="MAP-Name">
<map name="MAP-Name">
<area shape="rect|circle|poly" coords="#" href="url">
</map>

其中,坐标coords对各个shape的解释如下:

shape="rect" coords="x1,y1,x2,y2" // (x1,y1)=Upper Left, (x2,y2)=Lower Right

即,当shape是矩形时,coords表示矩形左上及右下(x2, y2)的坐标
shape="circle" coords="x,y,r" // (x,y)=Center, r=Radius

即,当shape是圆形时,coords表示圆中心点坐标(x, y)及半径

shape="poly" coords="x1,y1,x2,y2,x3,y3..." // (x1,y1>=First Corner, (x2,y2)=Second Corner, ...

即,当shape是poly多边形时,coords表示多边形所有顶点的坐标(x1,y1),(x2,y2),(x3,y3)...

 

注意:以上所有坐标都是相对于图形img.gif左上脚坐标而言的

 

以下是一个例子:

<img src="mapimg.gif" usemap="#Face">
<map name="Face">
   <area shape="rect" href="page.html" coords="140,20,280,60">
   <area shape="poly" href="image.html" coords="100,100,180,80,200,140">
   <area shape="circle" href="new.html" coords="80,100,60">
</map>

-------------------------------------------------------------------------------------------------------------

HTML元素 - map

包含客户端图像映射的坐标数据。

Contains coordinate data for client-side image maps.

所谓图像映射,就是带有预先定义区域的图像,这些区域包含了指向其它文档或锚的链接。例如,你可以在一副太阳系的图像上创建用户点击后可浏览不同星球的链接。

map 对象由 IMG 元素的 USEMAP 属性引用,格式如下:

<IMG SRC="solarsys.gif" USEMAP="#SystemMap">

MAP 元素包含一组定义图像中链接区域的 AREA 元素。


http://www.niftyadmin.cn/n/589587.html

相关文章

isinf未定义

C11以上编译器使用std::isinf(),修改使用头文件<cmath> #ifdef _MSC_VER! _finite(n) #elif __cplusplus>201103L || !(defined(isnan) && defined(isinf))std::isnan(n) || std::isinf(n) #elseisnan(n) || isinf(n) #endif

C标准:C90、C99、C11

https://blog.csdn.net/u010871244/article/details/38586933

Linux绝对路径访问上级目录,Linux kernel 绝对路径之d_path篇

摘自&#xff1a;https://blog.csdn.net/cenziboy/article/details/8761621一. d_path函数说明d_path 是内核提供的根据dentry和vfsmount获取绝对路径函数此函数有2个版本&#xff0c;以内核版本2.6.25为分界extern char *d_path(const struct path *, char *, int);extern cha…

Linux增加四个用户分别并命名,16、Linux用户和组管理命令演练和实战应用,,150R...

一、内容回顾bash globing&#xff0c;*&#xff0c;&#xff1f;&#xff0c;[],[^]IO重定向及管道 > , >> , 2> , 2>> &> , &>> > /tmp/a.txt 2>&1 ,< , << 命令tr &#xff0c;tee【三通】…

std::sort函数中的陷阱

https://blog.csdn.net/lingling_1/article/details/46453013

嵌入式linux矩阵键盘,基于嵌入式Linux的矩阵键盘驱动程序开发

O 引 言随着以计算机技术、通信技术和软件技术为核心的信息技术的发展&#xff0c;嵌入式系统在各个行业中得到了广泛的应用。嵌入式系统已成为当今IT行业的焦点之一。而在嵌入式系统中&#xff0c;键盘是重要的人机交互设备之一。嵌入式Linux是一种开放源码、软实时、多任务的…

git中fatal: Authentication failed的问题

https://blog.csdn.net/qq_34665539/article/details/80408282

java读取接口返回的json数据 (二)

注释文本可以全部删除&#xff0c; java读取 其他服务接口 返回的json数据 package cn.wangshiyu777;import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLConnection…