css settings page content can not be selected

Browsing the web, experience some of the text you want to copy is not selected

If we want to achieve this effect, only need to set a css property on this part of the text of the label includes

user-select:none

But the low version of the IE browser is invalid, want to achieve this effect, you can use the tag attribute onselectstart="return false;"to achieve

    < Div class = "the Test" > 
        I can not get you 
    </ div >
 .test {
            user-select: none
        }

Write, text page display can not be selected

In order to use more than one browser, you can write, but IE should be achieved through inline property

  .test {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

 

Guess you like

Origin www.cnblogs.com/zhangcheng001/p/11497176.html