How to make certain text not selectable with CSS [duplicate]
This question already has an answer here:
The header for my page has some centered text, but I do not want the user to be able to select it. Is there a way to do this with CSS?
The CSS below stops users from being able to select text.
-webkit-user-select: none; /* Chrome/Safari */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE10+ */ /* Rules below not implemented in browsers yet */ -o-user-select: none; user-select: none;
To target IE9 downwards and Opera the html attribute
unselectable must be used instead:
<p unselectable="on">Test Text</p>