TIL Disable users from highlighting text
POSTED ON:
TAGS: html css accessibility
I get it. You got a request from your boss to be a terrible human being.
They want to disable right-clicks.
They want to disable zoom to really hurt the accessibility.
They want to remove highlighting.
Heck, if they had it their way, you'll have to do a blood sacrifice to see their 'precious' content.
Well, to at least remove highlighting --
You can use the user-select
property to prevent an element from being highlighted by the user.
.no-highlight {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
Related TILs
Tagged: html