CSS 为图像地图(区域)中的链接添加悬停效果
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26634273/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding hover effects for links in image map (area)
提问by lu-bhz
I'm only a beginner in html and I would like to put hover effects for my image map. I have searched for lots of solutions but I only come up with solutions using script which I don't understand.
我只是 html 的初学者,我想为我的图像地图添加悬停效果。我已经搜索了很多解决方案,但我只使用我不理解的脚本提出了解决方案。
How does this script work? I tried using
这个脚本是如何工作的?我尝试使用
area:hover {
border: 1px solid white;
}
But it does not work.
但它不起作用。
回答by lu-bhz
What you're trying to do is not very simple, you will have to combine javascript and css or jquery to give the effect you want.
你想要做的不是很简单,你必须结合 javascript 和 css 或 jquery 来给出你想要的效果。
It's because the area
element doesn't accept hover
directly, unfortunately...
这是因为area
元素不hover
直接接受,不幸的是......
But the good news is that it was answered before here:
但好消息是,这里之前有人回答过: