1.1 KiB
1.1 KiB
Disable Selection
Makes the content unselectable.
HTML
<div>
<p class="unselectable"> You can't select me! </p>
<p> You can select me!! </p>
</div>
CSS
.unselectable {
user-select: none;
}
Demo
You can't select me!
You can select me!!
Explanation
user-select: none defines that the text cannot be selected.
Browser support
⚠️ Requires prefixes for full support and is not actually in any specification.