提问人:Jeff 提问时间:3/25/2017 最后编辑:CommunityJeff 更新时间:3/26/2017 访问量:1244
如何从Firefox中删除对焦环,主窗口的正确选择器是什么?
How to remove focus rings from Firefox, what is the correct selector for the main window?
问:
编辑:对焦环是由 Grab And Drag 插件引起的。请参阅下面的答案进行修复。
每当我点击网页主体的任何部分时,Firefox(Pale Moon 27.2.1)都会在浏览器窗口的周边放置焦点环(见截图)。它在每个网页上都这样做。
多年来,这个问题已经被问了一百万次,但似乎没有一个旧的解决方案已经奏效了。请参阅此处和此处。
我可以告诉你一些有效和无效的事情:
“通配符”选择器通过以下声明删除了焦点环,但显然会破坏所有网站:
* {
/* WORKS */
color: transparent !important;
text-shadow: 0 0 0 #000 !important;
/* ALSO WORKS */
border: 1px solid white !important;
outline: 2px solid white !important;
outline-offset: -1px !important;
}
这些选择器不起作用:
:focus
::-moz-focus-inner
:-moz-focusring
:active
:focus
::-moz-focus-outer
这些声明不起作用:
border: 0 !important;
border: none !important;
outline: 0 !important;
outline: none !important;
-moz-outline-style: /* NOPE */;
截图:
我正在使用Stylish来设置上述规则的所有网页的样式()。我还使用了另一个时尚规则集,它看起来像这样,适用于其他所有内容:@-moz-document url-prefix( "http://" ), url-prefix( "https://")
:active, :focus, ::-moz-focus-inner {
outline: 0 !important;
}
a:link, a:visited, a:hover, a:active {
outline: 0 !important;
}
radio * {
border-width: 0 1px 0 0 !important;
border-style: dotted !important;
border-color: transparent !important;
}
答:
0赞
Jeff
3/25/2017
#1
这确实如此,尽管我仍然想知道Firefox正在“着色”什么?
编辑:对焦环是由抓取和拖动插件 >= v.3.2.* 引起的。对我来说,解决方法是使用 Grab And Drag v.3.1.9.1,当单击和拖动身体时,它不会在网页主体上显示任何焦点环。
@-moz-document regexp( "https?://.*" ) {
html {
/**
* Remove focus rings that appear on the perimeter of the web page
* body when placing cursor in any form field input, then clicking
* anywhere in the body.
*
* This css rule breaks a lot of websites!
*
* - Works on html tag, but not body tag.
* - Does not work with "outline: 0 !important;" or
* "border: 0 !important;"
* - This declaration is not necessary:
* "text-shadow: 0 0 0 #000 !important;"
*/
color: transparent !important;
}
}
评论
*
html
body