0

Try to click in any empty area and drop, this will cause a blue background selection for the page elements like text and images,

To see this behavior clearly, click ctrl+A now.

I have a black theme in a website and some controls requires drag and drop, many visitors drag empty areas by mistake and drop which will cause the unsuitable default elements selection, is there any way to prevent this selection?.

Alaa Alweish
  • 8,904
  • 16
  • 57
  • 84
  • Try this http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting ... But this is a wild guess because you didn't show us the website or some code example – thinklinux Nov 03 '12 at 11:21
  • @thinklinux, in any website, here for example, try to click on the white area beside the scroll bar and drop, this will cause the default selection for the page elements. – Alaa Alweish Nov 03 '12 at 11:27
  • 1
    Well this website has a container div.. use your developer toolkit and assign the css rules that I gave you in the post above. You will not be able to select anything. Don't you want that behavior? – thinklinux Nov 03 '12 at 11:35
  • @thinklinux, Correct, different question but the answer worked, I've applied this rules on the `html, body` class like the following: `html, body { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }` Thanks, please answer this question with reference to that post. – Alaa Alweish Nov 03 '12 at 11:41

1 Answers1

1

How to disable text selection highlighting using CSS?

This website has a container div.. use your developer toolkit and assign the css rules that I gave you in the post above. You will not be able to select anything.

Community
  • 1
  • 1
thinklinux
  • 1,287
  • 9
  • 13
  • 1
    Thanks!, even for html,body classes it worked, to prevent the ctrl+A selection, `html, body { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } ` – Alaa Alweish Nov 03 '12 at 11:57