本文翻译自:How to reset / remove chrome's input highlighting / focus border? [duplicate]
This question already has an answer here: 这个问题在这里已有答案:
I have seen that chrome puts a thicker border on :focus
but it kind of looks off in my case where I've used border-radius also. 我已经看到镀铬会在边框上加上一个更厚的边框:focus
但在我的情况下我也会使用border-radius。 Is there anyway to remove that? 反正有没有删除?
#1楼
参考:https://stackoom.com/question/CLka/如何重置-删除chrome的输入突出显示-焦点边框-重复
#2楼
This will definitely work. 这肯定会奏效。 Orange outline won't show up anymore.. Common for all tags: 橙色轮廓将不再出现..所有标签的共同点:
*:focus {
outline: none;
}
Specific to some tag, ex: input tag 特定于某些标签,例如:输入标签
input:focus{
outline:none;
}
#3楼
I had to do all of the follow to completely remove it 我必须完成以下所有操作才能完全删除它
outline-style:none;
box-shadow:none;
border-color:transparent;
#4楼
Problem is when you already have an outline. 问题是你已经有了一个大纲。 Chrome still changes something and it's a real pain. Chrome仍然会改变一些东西,这真的很痛苦。 I cannot find what to change : 我找不到要改变的地方:
.search input {
outline: .5em solid black;
width:41%;
background-color:white;
border:none;
font-size:1.4em;
padding: 0 0.5em 0 0.5em;
border-radius:3px;
margin:0;
height:2em;
}
.search input:focus, .search input:hover {
outline: .5em solid black !important;
box-shadow:none;
border-color:transparent;;
}
.search button {
border:none;
outline: .5em solid black;
color:white;
font-size:1.4em;
padding: 0 0.9em 0 0.9em;
border-radius: 3px;
margin:0;
height:2em;
background: -webkit-gradient(linear, left top, left bottom, from(#4EB4F8), to(#4198DE));
background: -webkit-linear-gradient(#4EB4F8, #4198DE);
background: -moz-linear-gradient(top, #4EB4F8, #4198DE);
background: -ms-linear-gradient(#4EB4F8, #4198DE);
background: -o-linear-gradient(#4EB4F8, #4198DE);
background: linear-gradient(#4EB4F8, #4198DE);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4EB4F8', endColorstr='#4198DE');
zoom: 1;
}
#5楼
The simpliest way is to use something like this but note that it may not be that good. 最简单的方法是使用这样的东西但注意它可能不那么好。
input {
outline: none;
}
I hope you find this useful. 希望这个对你有帮助。
#6楼
border:0;
outline:none;
box-shadow:none;
This should do the trick. 这应该可以解决问题。