* Improve usage share * Remove 'No caveats' note from all snippets * Fix transform-centering usage: #search -> #feat * transform -> transforms2d * Add missing link for multiline truncate
616 B
616 B
Disable selection
Makes the content unselectable.
HTML
<p>You can select me.</p>
<p class="unselectable">You can't select me!</p>
CSS
.unselectable {
user-select: none;
}
Demo
Explanation
user-select: none specifies that the text cannot be selected.
Browser support
⚠️ Requires prefixes for full support.
⚠️ This is not a secure method to prevent users from copying content.