How to disable the selection of text in a div when the mouse moves the div

Source: Internet
Author: User

This is a CSS style to implement the Disable mouse selection function: unselectable for IE preparation, onselectstart for Chrome, safari preparation,-moz-user-select is the cssstyle of FF:

Html,body{-moz-user-select:none;-khtml-user-select:none; user-select:none;}
<div unselectable= "on" onselectstart= "return false;" style= "-moz-user-select:none;" >


masking the selected style definition:-moz-user-select property (FF only).

property has three property values: 

1, none: With none, the child elements of all the text can not be selected, including input box text can not be selected.
2.-moz-all: All the text of the child element can be selected, but the text in the input box cannot be selected.
3.-moz-none: All the text of the child element cannot be selected, except for the text in the input box.

How to disable the selection of text in a div when the mouse moves the div

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.