开发者

Remove blue overlay/highlight from selected images

开发者 https://www.devze.com 2023-02-15 14:57 出处:网络
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

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 ht开发者_如何学编程ml 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>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消