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)