When an html element is 'focused' (currently selected/tabbed in to), many browsers (at least Safari and Chrome) will put a blue border around it.
For the layout I am working on, this is distracting and does not look right.
<input type="text" name="user" class="middle" id="user" tabindex="1" />
FireFox does not seem to do this, or at least, will let me control it with
border: x;
If someone can tell me how IE performs, I would be curious.
But getting Safari to remove this little bit of flare would be nice.
I tried all the answers and I still couldn't get mine to work on Mobile, until I found
-webkit-tap-highlight-color
.So, what worked for me is...
Removing all focus styles is bad for accessibility and keyboard users in general. But outlines are ugly and providing a custom focussed style for every single interactive element can be a real pain.
So the best compromise I've found is to show the outline styles only when we detect that the user is using the keyboard to navigate. Basically, if the user presses TAB, we show the outlines and if he uses the mouse, we hide them.
It does not stop you from writing custom focus styles for some elements but at least it provides a good default.
This is how I do it: