Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Disabling the text selection with the help of css

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 316
    Comment on it

    In many cases we do not want that the user can select the text of the website for privacy reason.

    Using CSS property, we can restrict user to do so.

    Here is the code below:

    .disable-selection {
         -moz-user-select: none; /* Firefox */
          -ms-user-select: none; /* Internet Explorer */
       -khtml-user-select: none; /* KHTML browsers (e.g. Konqueror) */
      -webkit-user-select: none; /* Chrome, Safari, and Opera */
      -webkit-touch-callout: none; /* Disable Android and iOS callouts*/
    }

     

     

    Please download the demo attached or comment, If you find anything tricky.

    Hope this will help you!

     

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: