Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

::selection pseudo-element

Applies one or more styles to any text on the page that the user has highlighted.

Internet Explorer 9



sel::selection {...}



A simple selector.


The ::selection pseudo-element is the UI element fragments pseudo-element. It is used to select any part of the page that the user has highlighted, including text within an editable text field. The CSS properties that apply to the ::selection pseudo-element are: color, background-color, and -ms-high-contrast-adjust properties.

Styling properties on the ::selection pseudo-element do not support the "inherit" value.



© 2015 Microsoft