Code Snippet
Remove Dotted Link Borders
Dotted borders around links are an accessibility feature most browsers have by default. It's for users who must or choose to navigate by keyboard, there is a visual style applied to those links when "tabbed" to. These borders also show up when the link is clicked (in it's "active" state), and can be an eyesore depending on the design (especially when using something like CSS image replacement, the borders span the length of the screen). You can remove them with this:
a:active {
outline: none;
}
NOTE: The advantage here is that the :focus style still will use the outlines, meaning that keyboard navigators will still have the focus styling/visual feedback.
Doesn’t work. Border is still there.
Then UR DOING IT WRONG
works fine!
It didn’t work for me on firefox until I added, a:focus then the outline disappeared.
So the final code was:
a:active,a:focus {
outline: none;
}
Graystatic is correct. Needed the a:focus in Firefox to work.
However wouldn’t that negate the keyboard navigators feedback?
Same for me. For Firefox it needs to be
a:active, a:focus { outline: none; }
i really liked this way of removing the border.
but at the same time when the user browse the page using TABS, show the a:hover property on each links instead of the dotted border
found out how to do it.
actually i didn’t know that :focus is used for applying styles when it gets keyboard focus.
by applying the required style to :focus , i was able to do this
Works fine, thanks
Yup. if you add a:focus, she works great in Firefox!
CSS Reset documents often takes care of this
it helped to remove annoying outline (I was wrongly referring to it as ‘border’ before reading this tutorial) that FireFox was displaying around the html5 video I had on my web site. Thanks.
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.