CSS ::selection Selector

❮ Previous Selectors Next ❯


.example::selection {
  color: red;
  background-color: yellow;


The ::selection selector applies styles to the part of a document that has been highlighted by the user.

The following CSS properties can be applied:

Version: CSS3

Standard Syntax

::selection {
  css declarations;

Browser Support

The numbers in the table specify the first browser version that fully supports the property.


❮ Previous Selectors Next ❯