无法摆脱 Firefox 链接中的虚线轮廓?
我有一个完整的图像列表:
<ul>
<li><a href="#"><img src="test.png" /></a</li>
<li><a href="#"><img src="test.png" /></a</li>
<li><a href="#"><img src="test.png" /></a</li>
(...)
</ul>
当我在 Firefox 中单击它们时,会出现虚线轮廓(到底是谁发明的,为什么?太丑了!)。
我想摆脱它们,但样式“轮廓”等似乎不起作用,我已经尝试了以下所有选项:
#ul li img:active {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
#ul li img:focus {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
#ul li img a:active {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
#ul li img a:focus {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
I have a list full of a imgs:
<ul>
<li><a href="#"><img src="test.png" /></a</li>
<li><a href="#"><img src="test.png" /></a</li>
<li><a href="#"><img src="test.png" /></a</li>
(...)
</ul>
When I click them in Firefox, there's dotted outline (who the heck invented that and why? so ugly!).
I want to get rid of them, but style "outlines" etc. doesn't seem to work, I've tried all of options below:
#ul li img:active {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
#ul li img:focus {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
#ul li img a:active {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
#ul li img a:focus {
-moz-outline-style: none;
-moz-focus-inner-border: 0;
outline: none;
outline-style: none;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要将样式应用于
标记(后两个 CSS 规则是错误的,因为您已将
标记放入
。
这对我有用:
或者,仅适用于 ID 为
ul
的元素(顺便说一下,这不是最好的名称):You need to apply the styles to the
<a>
tag (your latter two CSS rules are wrong because you've put the<a>
tag inside<img>
.This works for me:
Or, for only inside the element with ID
ul
(not the best name, by the way):在 FF22 中为我工作
works for me in FF22
outline: 0 应该做到这一点,并且应该应用于
元素,该元素实际上不是
< 的子元素/代码>。
是
的子级,因此您的 css 应为:
outline: 0 should do it and it should be applied on the
<a>
element, which is not actually a child of<img />
.<img />
is a child of<a>
so your css should read: