Prepare repository for merge
This commit is contained in:
27
css/snippets/custom-text-selection.md
Normal file
27
css/snippets/custom-text-selection.md
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
title: Custom text selection
|
||||
type: snippet
|
||||
tags: [visual]
|
||||
cover: digital-nomad
|
||||
dateModified: 2020-12-30T15:37:37+02:00
|
||||
---
|
||||
|
||||
Changes the styling of text selection.
|
||||
|
||||
- Use the `::selection` pseudo-selector to style text within it when selected.
|
||||
|
||||
```html
|
||||
<p class="custom-text-selection">Select some of this text.</p>
|
||||
```
|
||||
|
||||
```css
|
||||
::selection {
|
||||
background: aquamarine;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.custom-text-selection::selection {
|
||||
background: deeppink;
|
||||
color: white;
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user