Prepare repository for merge
This commit is contained in:
23
css/snippets/disable-selection.md
Normal file
23
css/snippets/disable-selection.md
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
title: Disable selection
|
||||
type: snippet
|
||||
tags: [interactivity]
|
||||
cover: interior-9
|
||||
dateModified: 2020-12-30T15:37:37+02:00
|
||||
---
|
||||
|
||||
Makes the content unselectable.
|
||||
|
||||
- Use `user-select: none` to make the content of the element not selectable.
|
||||
- **Note:** This is not a secure method to prevent users from copying content.
|
||||
|
||||
```html
|
||||
<p>You can select me.</p>
|
||||
<p class="unselectable">You can't select me!</p>
|
||||
```
|
||||
|
||||
```css
|
||||
.unselectable {
|
||||
user-select: none;
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user