Skip to content

Commit 2e54946

Browse files
committed
Update css-practice.md
1 parent f9d5cf3 commit 2e54946

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

css-practice.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,9 @@ p {
11621162

11631163
How do you prevent the user from selecting the text rendered inside the following element?
11641164

1165+
```html
11651166
<p>I should not be selectable</p>
1167+
```
11661168

11671169
Pick ONE OR MORE options
11681170

@@ -1176,6 +1178,18 @@ Pick ONE OR MORE options
11761178
4. None of the above
11771179
```
11781180

1181+
<details><summary><b>Answer</b></summary>
1182+
1183+
```css
1184+
p {
1185+
user-select: none;
1186+
}
1187+
```
1188+
1189+
**&#9885; [Try this example on CodeSandbox](https://codesandbox.io/s/css-selection-kvuzpr?file=/src/styles.css)**
1190+
1191+
</details>
1192+
11791193
<div align="right">
11801194
<b><a href="#">↥ back to top</a></b>
11811195
</div>

0 commit comments

Comments
 (0)