Custom text selection
Changes the styling of text selection.
- Use the
::selection
pseudo-selector to style text within it when selected.
<p class="custom-text-selection">Select some of this text.</p>
::selection { background: aquamarine; color: black; } .custom-text-selection::selection { background: deeppink; color: white; }