Home Tips How to Disable Text Selection using CSS

How to Disable Text Selection using CSS

467
0
SHARE
How to Disable Text Selection using CSS

Are you looking to disable text selection or text highlighting by user in your website or blog without using any codes like javascript etc. then use or follow this article to disable user selection in your website like content/ text highlighting.

We are giving this code is only for the people who are looking to “how to disable text selection using CSS code. It is best option and solution to prevent use selection text or highlighted  in your website.

You need to add below CSS code into your website then you can see that users are unable to select or highlight text from your website.

body {

-webkit-touch-callout: none;

-webkit-user-select: none;

-khtml-user-select: none;

-moz-user-select: none;

-ms-user-select: none;

user-select: none;

}

For blogger’s must add this code before to ]]></b:skin>

We have tried above code on below lines so you can test the code is working or not

Check this text by selecting or highlight with you mouse, we have applied above code to this line for you to confirm and trust

LEAVE A REPLY