HTML的标签支持使用
具体步骤如下:
示例代码如下:
<img src="example.jpg" usemap="#exampleMap"><map name="exampleMap"> <area shape="rect" coords="0,0,100,100" href="http://example.com"> <area shape="circle" coords="150,150,50" href="http://example.com"> <area shape="poly" coords="250,250,300,300,350,250" href="http://example.com"> </map>
上述代码实现了一个包含三个热区的图片映射。第一个热区是一个矩形,左上角坐标为(0,0),右下角坐标为(100,100),点击后会跳转到http://example.com;第二个热区是一个圆形,圆心坐标为(150,150),半径为50,点击后也会跳转到http://example.com;第三个热区是一个多边形,三个顶点的坐标分别是(250,250)、(300,300)和(350,250),点击后同样会跳转到http://example.com。