Turn off link selection

Hey, they are just wondering if you can turn off the "selection" that you get when you click on the link. I want my link to display as an image. In other words, I do not want the selection window to appear when clicked.

+5
source share
4 answers

This can be done using CSS by setting outlinefocus links:

a.image-link:focus { outline: 0; }

But you need to remember that it always defines an alternative style (for example, changing the color or changing the background of the image so that the user knows that he clicked). Else, DO NOT DO IT! .

, , , , .

+12

, , . :

a { outline: none; }
+6
<style>
a,a:hover,a:click, a:visited{
  border:none;
  outline:none;
  text-decoration:none;
  color:inherit;
}
</style>
+1
source

You also need to control the -webkit-tap-highlight-color color, and you need to provide alternative styles, especially for users who move with the tab key and rely on some kind of selection to see where they are. So this gives ...

<style>
a,a:hover,a:click, a:visited{
  border:none;
  outline:none;
  text-decoration:none;
  color:inherit;
  -webkit-tap-highlight-color: white;
}
</style>
+1
source

All Articles