问题
I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .
*:focus { outline:none; }
input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box-shadow:0 0 2px 0 #0066FF;
-webkit-box-shadow:0 0 9px 0 #86AECC;
z-index:1;
}
fiddle: http://jsfiddle.net/DCjYA/309/
回答1:
Try this:
* {
outline-color: lime;
}
回答2:
for me this worked
:focus {
outline: -webkit-focus-ring-color auto 0;
}
回答3:
This should also do the trick:
a:focus, a:active {
outline-color: transparent !important;
}
回答4:
Most effective solution on Links only:
a:focus, a:active{
outline:none;
}
Or you can disable global:
*{
outline:none;
}
来源:https://stackoverflow.com/questions/9178718/chrome-default-focus-outline