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 =)
The blur() method removes focus from an element.
Answer: Use the CSS ::selection pseudo-element By default, when you select some text in the browsers it is highlighted normally in blue color. But, you can disable this highlighting with the CSS ::selection pseudo-element.
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. =)
See this fiddle.
It seems that you have to set some border property to make outline: none
work. If you comment in the border directive, the outline disappears.
input {border:0; outline:none;}
should remove all borders/outlines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With