简体   繁体   English

使img在文本后面可点击

[英]Make a img clickable behind a text

I have an image (a round image) with a circle shape area that is pointing to a certain URL, and on that image I have some text above it (a simple '< p >' tag) but the problem is now that you have to click on that image and not on the text to go to the URL, when you click on the text you are just selecting the text, nothing else. 我有一个图像(一个圆形图像),该图像具有一个指向特定URL的圆形区域,并且在该图像上我有一些文本(一个简单的“ <p>”标记),但是现在的问题是单击该图像而不是单击文本以转到URL,当您单击文本时,您只是在选择文本,仅此而已。

How can I fix that please ? 我该如何解决?

<p>this is the text<br />
that is not clickable, only selectable :( </p>
<img src="circle.png" alt="" usemap="#hitzone" />
<map name="hitzone">
    <area shape="circle" coords="0,0,100" href="#">
</map>

You can try: 你可以试试:

<p>
    <a href="your url here" style="text-decoration: none; color: black">Click me</a>
</p>
<img src="circle.png" alt="" usemap="#hitzone" />
<map name="hitzone">
    <area shape="circle" coords="0,0,100" href="#">
</map>

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

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