CSS 在输入字段内单击时如何删除/更改边框?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6274208/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove/change the border when clicking inside an input field?
提问by Cris
Click inside the search box at this site and you'll see what I mean. Is there a way to remove this? Also, if I decide to keep it, how can I change its dimensions?
在此站点的搜索框内单击,您就会明白我的意思。有没有办法去除这个?另外,如果我决定保留它,我该如何改变它的尺寸?
Thanks, Cris
谢谢,克里斯
回答by Petah
Try this:
尝试这个:
input[type="text"], input[type="password"], textarea, select {
outline: none;
}
回答by Indrajith_kb
try this also.
也试试这个。
*:focus {
outline: none;
}
回答by Peter Drinnan
Sometimes what looks like a border is really a border shadow as in the case of Bootstrap, so you would use:
有时看起来像边框的实际上是边框阴影,就像 Bootstrap 一样,所以你可以使用:
#myelement:focus {
box-shadow: none;
}