views:

1533

answers:

2

Is there a way to get rid of the selection rectangle when clicking a link which does not refresh the current page entirely?

+3  A: 

Try adding this:

onclick="this.blur()"

Discussed here as well

http://stackoverflow.com/questions/176695/css-eliminating-browsers-selected-lines-around-a-hyperlinked-image

Lou Franco
It's easier to use the CSS focus attribute, but this will work in older browsers.
Ross
+11  A: 

Do you mean the dotted outline of a target?

Try:

:focus {
    outline: 0;
}

This would remove all focus outlines. IT's essentially the same as onclick in JavaScript terms. You might prefer to apply this to a:focus.

Ross
As pointed out in the answer to the question linked to below: "the outline is essential for keyboard-navigators as it designates where your selection is and, so, gives a hint to where your next 'tab' might go. Thus, it's inadvisable to remove this dotted-line selection."
Sam Hasler
I agree, I often add my own focus effects. An opacity decrease for images and a background/color change for navigation items for example.
Ross