daveycroqet
daveycroqet

Reputation: 2727

Disable or change Firefox's element/image highlight color

I want to get rid of the faded blue highlight color for certain elements (in particular, images). Here's a Fiddle for examplary purposes. Notice that when you highlight the text, it's appropriately yellow, as per the CSS. But when you drag-select to encompass the kittens, and/or you simply press CTRL+A to highlight the entire body, you get the faded blue selection color around the images.

Chrome lets you disable this entirely and/or change it. Is there really no Mozilla equivalent? Because evidently ::-moz-selection is not the answer:

div ::-moz-selection {
    background-color: yellow;
}

This only works for the text. What about a method using JavaScript? Does such a thing exist?

Upvotes: 3

Views: 2065

Answers (2)

itsMeAra
itsMeAra

Reputation: 156

I don't think you can change the color of the highlight on the image but you can get rid of the highlight completely by doing this:

div {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

fiddle: http://jsfiddle.net/6Qqzq/33/

Upvotes: 6

Slawa Eremin
Slawa Eremin

Reputation: 5415

Try to use this code:

-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

Upvotes: 1

Related Questions