dave dave - 11 months ago 52
CSS Question

how do i stop highlighting of a div element when double-clicking on?

I have this div element with a background image and i want to stop highlighting on the div element when double-clicking it. Is there a css property for this?


The CSS below stops users from being able to select text. Live example: http://jsfiddle.net/hGTwu/20/

-webkit-user-select: none; /* Chrome/Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */

/* Rules below not implemented in browsers yet */
-o-user-select: none;
user-select: none;

To target IE9 downwards and Opera the html attribute unselectable must be used instead:

<div unselectable="on">Test Text</div>