删除HTML / CSS中输入框上的蓝色焦点矩形? [英] Getting rid of the blue focus rectangle on input boxes in HTML/CSS?

查看:199
本文介绍了删除HTML / CSS中输入框上的蓝色焦点矩形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Mac OS,所以我不能真正告诉这个效果是否出现在Windows机器上,所以我道歉,如果这个效果没有看到你。

I'm running Mac OS so I can't really tell if this effect is presented on windows machines or not, so I apologize if this effect is not seen for you.

输入和TextFields在聚焦时似乎有一个蓝色矩形,至少在Firefox和Chrome上的Mac。我对网站有一个自定义焦点效果,我想知道我是否可以避免有这个默认选择行为显示。 Google避免在自己的网站上。我尽量为Google的输入框获取有效的CSS样式,并将其应用于我的css对象。但是,它仍然显示蓝色矩形。我不知道什么样的voodoo google做,但在我看来,它既不是HTML或CSS属性。任何人都知道如何避免这种影响?谢谢!

Input and TextFields seem to have a blue rectangle when focused, atleast on Firefox and Chrome on a Mac. I have a custom focus effect on a site, and I'm wondering if I can avoid having this default selection behavior show. Google avoids it on their site. I went as far as to get the 'in-effect' CSS style for Google's input box, apply that to my css object. However, it still shows the blue rectangle. I'm not exactly sure what kind of voodoo google is doing, but it seems to me that it's neither HTML or CSS attributes. Anyone know how to avoid this effect? Thanks!

推荐答案

它实际上是一个CSS属性。这将隐藏发光效果:

It is in fact a CSS attribute. This will hide that glowing effect:

input:focus, textarea:focus {
    outline: none;
}

这篇关于删除HTML / CSS中输入框上的蓝色焦点矩形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆