将悬停边框应用于图像
我无法在图像上进行悬停,我确定我错误地定位了 css 悬停,但我还有一些附加在图像上的 jquery,这可能会导致冲突。
这是小提琴:
http://jsfiddle.net/MLS1984/9zwsJ/
基本上我只是边框出现在悬停状态。
I'm not able to get a hover on my images to work, I'm sure I'm targeting the css hover incorrectly, but I also have some jquery that is attached the the images which may be causing the conflict.
Here is the fiddle:
http://jsfiddle.net/MLS1984/9zwsJ/
Basically I just the border to appear on a hover state.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
http://jsfiddle.net/AlienWebguy/KB9S4/
http://jsfiddle.net/AlienWebguy/KB9S4/
在我看来,有两件事是错误的。
您的
a
位于图像外部,但您的选择器正在图像内部查找它。另外,您还有一个拼写错误:teaming
和teamimg
不匹配。:
所以改变
Two things appear wrong to me.
Your
a
is outside the image but your selector is looking for it inside. Also, you have a typo:teaming
andteamimg
don't match up.So change:
to
它应该是:
你有:
这有两个问题。首先,
teaming
是错误的,它是teamimg
(是 m 而不是 n)。第二,img
位于a
之前It should be:
You had:
Two things wrong with this. First
teaming
is wrong, it'steamimg
(an m not an n). 2nd, theimg
comes before thea
这是解决方案
http://jsfiddle.net/9zwsJ/14/
Here's the solution
http://jsfiddle.net/9zwsJ/14/
您对这种样式的排序错误:
img.teaming 在标签内,因此它应该是:
我不相信这会在所有浏览器中工作,但是(即?)。如果您知道该无序列表中的所有链接都将包含图像,您可以将边框应用到 a 标签本身:
或
祝您好运!
You're mis-ordering this style:
img.teaming is inside the tag, therefore it should read:
I don't believe that will work in all browsers, however (ie?). If you know all the links in that unordered list are going to contain images, you could just apply the border to the a tag itself:
or
Best of luck!
img
位于a
内部,因此您希望定位a
并将其移至img
之前CSS 选择器。您可以在这里看到我的作品:http://jsfiddle.net/Skooljester/9zwsJ/16/The
img
is inside thea
, so you want to target thea
and move it before theimg
in the CSS selector. You can see my work here: http://jsfiddle.net/Skooljester/9zwsJ/16/