Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Disable text selection highlighting using css

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 432
    Comment on it

    Hi all,

    Below is an example, How to disable the text selection and copy text.

    Controls the actual Selection operation. This doesn't have any effect on content loaded as chrome, except in textboxes.

    CSS :-

    .noselect {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    

    HTML :-

    <p>
      This text can be select and copy
    </p>
    <p class="noselect">
      This text can't be select and copy
    </p>
    

    Output :-

    This text can be select and copy

    This text can't be select and copy

 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: