Files
30-seconds-of-code/snippets/disable-selection.md
atomiks 39b676c125 Improve usage share count (#138)
* Improve usage share

* Remove 'No caveats' note from all snippets

* Fix transform-centering usage: #search -> #feat

* transform -> transforms2d

* Add missing link for multiline truncate
2019-02-18 04:35:48 +11:00

35 lines
616 B
Markdown

### Disable selection
Makes the content unselectable.
#### HTML
```html
<p>You can select me.</p>
<p class="unselectable">You can't select me!</p>
```
#### CSS
```css
.unselectable {
user-select: none;
}
```
#### Demo
#### Explanation
`user-select: none` specifies that the text cannot be selected.
#### Browser support
<span class="snippet__support-note">⚠️ Requires prefixes for full support.</span>
<br>
<span class="snippet__support-note">⚠️ This is not a secure method to prevent users from copying content.</span>
- https://caniuse.com/#feat=user-select-none
<!-- tags: interactivity -->