text-decoration in ::selection
The text-decoration CSS property in a ::selection rule sets the underline and other text decoration styles on the text a user has highlighted.
Overview
The text-decoration CSS property in a ::selection rule sets the underline and other text decoration styles on the text a user has highlighted.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
css.selectors.selection.text-decoration | 105 | 105 | | | 105 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
::selection {
text-decoration: underline wavy;
text-decoration-color: #e74c3c;
background-color: #ffeaa7;
} Live demo
Use cases
Using text-decoration in ::selection
The text-decoration CSS property in a ::selection rule sets the underline and other text decoration styles on the text a user has highlighted.
Cautions
- Limited browser support. Check compatibility before use.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.
Related links
Powered by web-features