I have a div on a HTML page and whenever I press the mouse and move it, it will show that “can’t drop” cursor like it selects something. Is there a way to disable selection? I tried CSS user-select with none without success.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The proprietary variations of
user-selectwill work in most modern browsers:For IE < 10 and Opera, you will need to use the
unselectableattribute of the element you wish to be unselectable. You can set this using an attribute in HTML:Sadly this property isn’t inherited, meaning you have to put an attribute in the start tag of every element inside the
<div>. If this is a problem, you could instead use JavaScript to do this recursively for an element’s descendants: