phenomenon : There may be some places in the HTML do not want users to copy text, or a tag to do a click button, the text will be selected quickly, very ugly, this time you can use the following scheme to prohibit text selection.
cause: The mouse point is fast and the text is selected.
Solution Solutions: Different browser settings are not the same, User-select is not a standard, browser support is not complete, you need to adjust the different browsers.
1 Body{2 3 -moz-user-select:None;/*Firefox*/4 5 -webkit-user-select:None;/*WebKit Browser*/6 7 -ms-user-select:None;/*IE10*/8 9 -khtml-user-select:None;/*Early Browser*/Ten One User-select:None; A -}
User-select has 2 values (none means that the text cannot be selected, text indicates that you can select it)
Ie6-9 has not found the relevant CSS properties
1 // ie6-9 2 3 document.body.onselectstart=document.body.ondrag=function() {45 Returnfalse; 6 7 }
For a chestnut: When doing the app often use the following ~ ~
1 Html,body {2 -webkit-touch-callout:; 3 -webkit-text-size-adjust:; 4 -webkit-tap-highlight-color:; 5 -webkit-user-select:; 6 }
CSS Control page text can not be selected User-select:none;