/* If you want to implement it in very old browser-versions */
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
/* The rule below is not implemented in browsers yet */
-o-user-select: none;
/* The rule below is implemented in most browsers by now */
user-select: none;
To target IE9 downwards and Opera the HTML attribute unselectable must be used instead:
I'm no CSS expert, but I think you can use tw16's answer as long as you expand the number of elements affected. For instance, this prevents highlighting everywhere on my page without affecting any other kind of interactivity:
I was trying to find a solution to stopping div highlighting in Chrome, and turned to this post.
But, unfortunately, none of the answers solved my problem.
After a lot of online research, I found that the fix is something very simple. There is no need for any complex CSS. Just add the following CSS to your web page and you are all set. This works in laptops as well as mobile screens.