如何重置/删除chrome的输入突出显示/焦点边框? [重复]

本文翻译自:How to reset / remove chrome's input highlighting / focus border? [duplicate]

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? 反正有没有删除?

图像:chrome:焦点边框


#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. 这应该可以解决问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值