5

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/

BurebistaRuler
  • 6,209
  • 11
  • 48
  • 66

4 Answers4

13

Try this:

* { 
    outline-color: lime;
}
Adi
  • 5,089
  • 6
  • 33
  • 47
mcmwhfy
  • 1,654
  • 5
  • 36
  • 58
  • The only answer that doesn't break navigation experience for keyboard or assistive technology users… http://www.outlinenone.com/ – Volker E. Mar 12 '19 at 20:23
2

for me this worked

 :focus {
       outline: -webkit-focus-ring-color auto 0;
 }
csomakk
  • 5,369
  • 1
  • 29
  • 34
1

This should also do the trick:

a:focus, a:active {
    outline-color: transparent !important;
}
Ikbel
  • 7,721
  • 3
  • 34
  • 45
0

Most effective solution on Links only:

a:focus, a:active{
    outline:none;
}

Or you can disable global:

*{
    outline:none;
}
Uranbold
  • 45
  • 6