On Not | Mo Chit

June 05, 2004

CSS: Defeat the focus rect in Mozilla Normally in Mozilla, when you click on a link, you get that nasty focus rectangle around it (see image).
MozFocusRect.gif
Well thankfully there is easy fix. Just wrap everything inside the link in an empty tag and you're all done. The only downside is that you introduce non-semantic markup, but it's there if you need it. The technique also works in Safari.

Update: The original post was incorrect stating that the link needed to be wrapped by a span tag. This will not work, the link must wrap the span tag. How about an example to clarify:

  Going Nowhere

Creative Commons License
This site is licensed under a
Creative Commons License