CSS ::selection Pseudo-element
- Página anterior ::placeholder
- Página siguiente ::spelling-error
- Volver a la capa superior Manual de referencia de pseudoelementos de CSS
Definition and Usage
CSS ::selection
Pseudo-elements are used to set the style of the selected text part of the user.
Note:The following properties can be used with ::selection
Used together:
- color
- background-color
- text-decoration
- text-shadow
Example
Set the text color to red and the background to yellow for the selected text of the user:
::selection { color: red; background: yellow; }
CSS Syntax
::selection { css declarations; }
Technical Details
Version: | CSS3 |
---|
Browser Support
The numbers in the table specify the first browser version that fully supports this pseudo-element.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
4 | 12 | 62 | 1.1 | 9.5 |
- Página anterior ::placeholder
- Página siguiente ::spelling-error
- Volver a la capa superior Manual de referencia de pseudoelementos de CSS