简体   繁体   English

如何将多个链接添加到图像的某些部分

[英]how to add multiple links to parts of an image

how would I add multiple links to an image.我将如何向图像添加多个链接。 Linking an image I would just wrap it with a href .链接图像我只是用a href包装它。 I would have an image of a tree with apples then I would want to add a link to each apple in the image.我会有一个带有苹果的树的图像,然后我想为图像中的每个苹果添加一个链接。 How would I do this?我该怎么做?

I was thinking of using position absolute but seems tedious especially when trying to make it mobile responsive of moving the links.我正在考虑使用绝对位置,但似乎很乏味,尤其是在尝试使其移动响应移动链接时。

Apple Tree苹果树

You can use Image Map Generator您可以使用图像映射生成器

 .wrap { transform: scale(0.3); width: 0px; height: 0px; }
 <div class="wrap"> <img src="https://www.freepngimg.com/thumb/tree/76337-vector-fruit-tree-apple-download-free-image.png" usemap="#image-map"> <map name="image-map"> <area target="" alt="" title="" href="#1" coords="626,247,775,130" shape="rect"> <area target="" alt="" title="" href="#2" coords="495,265,632,378" shape="rect"> <area target="" alt="" title="" href="#3" coords="620,437,750,558" shape="rect"> <area target="" alt="" title="" href="#4" coords="346,829,467,931" shape="rect"> <area target="" alt="" title="" href="#5" coords="579,937,707,1041" shape="rect"> <area target="" alt="" title="" href="#6" coords="885,289,1029,386" shape="rect"> <area target="" alt="" title="" href="#7" coords="1082,540,1210,652" shape="rect"> <area target="" alt="" title="" href="#8" coords="1268,926,1403,1035" shape="rect"> <area target="" alt="" title="" href="#9" coords="1025,1096,1171,1206" shape="rect"> </map> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM