CSS Firefox - 如何停用虚线边框(firefox 单击指示器)?

发布于 2024-10-04 13:00:53 字数 142 浏览 1 评论 0原文

对于我最近的网络项目来说,这个点击指示器是一个令人厌恶的部分。我讨厌这个! - 我如何对我的 Firefox 浏览器说他不应该标记单击的对象?

替代文字

This click indicator is a disgusting piece for my recent web projects.. I hate this! - How can I say to my Firefox browser that he should not mark the clicked object?

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

俏︾媚 2024-10-11 13:00:53

如果您的菜单项不是输入元素(例如按钮),您可以使用 CSS 隐藏它,如下所示:

element { outline: none; }

Provided that your menu items are not input elements (say, buttons), you can hide it using CSS, like so:

element { outline: none; }
神经大条 2024-10-11 13:00:53

一个{
概要:无;
}

a {
outline: none;
}

标点 2024-10-11 13:00:53

在这之前没有任何帮助(Firefox 20.1):

a:focus, a:active,
button,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
select::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
    outline: none !important;
}

Nothing helped (Firefox 20.1) until this:

a:focus, a:active,
button,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
select::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
    outline: none !important;
}
黒涩兲箜 2024-10-11 13:00:53

这是更准确的:

a { outline: none!important; }

this is more accurate:

a { outline: none!important; }
苹果你个爱泡泡 2024-10-11 13:00:53

更具体地说,您可以删除悬停时的轮廓(假设鼠标输入),但将其保留为焦点(假设键盘输入)。这将保留大部分可访问性。话虽这么说:

element:hover { outline: none; }
element:focus { // leave the focus }

To be more specific to @ioannis-karadimas, you could remove the outline on hover (assuming mouse input) but leave it for focus (assuming keyboard input). This would retain most of the accessibility. That being said:

element:hover { outline: none; }
element:focus { // leave the focus }
赴月观长安 2024-10-11 13:00:53

基于这篇文章 ,添加 outline:0 也能达到目的。

.selector{ outline:0; }

如果您不想让网站中的任何元素显示边框,请尝试以下操作,

:focus { outline:none; }
::-moz-focus-inner { border:0; }

Based on this post, adding outline:0 will also do the trick.

.selector{ outline:0; }

If you don't want to have the border shown to any element in your website, try the following,

:focus { outline:none; }
::-moz-focus-inner { border:0; }
丿*梦醉红颜 2024-10-11 13:00:53

您可能讨厌它,但您的客户可能不喜欢。一般来说,覆盖浏览器功能是迷惑用户并促使他们不访问您的网站的好方法。

You might hate it, but your customers might not. Generally speaking overriding browser functionality is a great way to confuse users and inspire them not to visit your site.

静谧 2024-10-11 13:00:53

疯狂的解决方案:

input[type="button"]::-moz-focus-inner{
    border: 1px dotted transparent;
}

但我不喜欢它。

事实上,当我单击输入类型=“按钮”时,Firefox 12.0 会在输入类型上标记一个点。 outline:none:active, :focus, ... 没有任何作用

Crazy solution:

input[type="button"]::-moz-focus-inner{
    border: 1px dotted transparent;
}

but I dislike it.

Indeed Firefox 12.0 is marking a dotted on input type="button" when I click it. outline:none does nothing for :active, :focus, ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文