1

enter image description here

i have some divs, when i double click on the any of the div there is blue background selection
are shown, i donot want this blue selection background , this looks weired.. any help to remove this seletion background... in the image there is grey background

Jot Dhaliwal
  • 1,470
  • 4
  • 26
  • 47

2 Answers2

2

You can make use of user-select

(-prefix-)user-select: none;

The text of the element and sub-elements will not be able to be selected.

Praveen
  • 55,303
  • 33
  • 133
  • 164
  • this provided to the specific div which shows the blue background – Jot Dhaliwal Jan 01 '14 at 09:06
  • 1
    @Jat.net this is disable the double click in the div so there will be no blue color. Incas if you want to change the color then you can use `(-webkit-)-tap-highlight-color` works only in chrome and safari – Praveen Jan 01 '14 at 09:08
2

check out this fiddle

http://jsfiddle.net/Ajey/Jk6XF/

we make use of the property user-select: none;

if you want this to be cross browser, make sure you include all the vendor prefixes

Although using this property should be avoided. But if this makes you happy, go ahead ;)

Ajey
  • 7,924
  • 12
  • 62
  • 86