CSS - Removing input field active highlight

Kizer Yakuza picture Kizer Yakuza · Mar 16, 2013 · Viewed 52.4k times · Source

Using only html and css, how do I disable the blue (in Firefox) highlight color around an active input field. I've tried using input {outline:none;} but with no success. Thanks for the help! =)

ok,ignoring the previous code about outline, I chose the wrong property to change. What I'm trying to get is to simply remove the highlighting (whatever browser, its the bold and colored border that appears) around an active form input field, without changing or disabling the styling. Thanks =)

Answer

Paula Fleck picture Paula Fleck · Jul 17, 2014

You have to use :focus declaration. In this case:

input:focus {outline:none;}

All the input's in your project won't have the blue border.

If you want a specific attribute, use this:

input[type=text]:focus {outline:none;}

Hope it helps. =)