How to remove Firefox's dotted outline on BUTTONS as well as links?
I can make Firefox not display the ugly dotted focus outlines on links with this:
a:focus {
outline: none;
}
But how can I do this for <button>
tags as well? When I do this:
button:focus {
outline: none;
}
the buttons still have the dotted focus outline when I click on them.
(and yes, I know this is a usability issue, but I would like to provide my own focus hints which are appropriate to the design instead of ugly grey dots)
Solution 1:
button::-moz-focus-inner {
border: 0;
}
Solution 2:
No need to define a selector.
:focus {outline:none;}
::-moz-focus-inner {border:0;}
However, this violates accessibility best practices from the W3C. The outline is there to help those navigating with keyboards.
https://www.w3.org/TR/WCAG20-TECHS/F78.html#F78-examples