Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove blue overlay/highlight from selected images

I'm making a web application with some animated clickable images and I notice (particularly in chrome but also in ff) that any slight accidental dragging over the image turns it blue. (to indicate it is selected) Is there any way in jquery, css or html to deactivate this annoying side effect, or perhaps is there a way to use images without having this default behaviour?

My images are inside unordered lists like this:

<ul>   <li><img src="path"/></li>   <li><img src="path"/></li>   <li><img src="path"/></li> </ul> 
like image 863
Pure Function Avatar asked Mar 07 '11 22:03

Pure Function


People also ask

How do you remove blue highlights?

Select the highlighted words. On the Home tab, click the arrow next to the Text Highlight Color button and choose No Color.

How do I remove blue highlight on click?

Answer: Use the CSS ::selection pseudo-element By default, when you select some text in the browsers it is highlighted normally in blue color. But, you can disable this highlighting with the CSS ::selection pseudo-element.


1 Answers

I think, to prevent user-selection cross-browser, you could use:

img { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -o-user-select: none; user-select: none; } 

JS Fiddle demo.

like image 56
David Thomas Avatar answered Oct 12 '22 07:10

David Thomas