Share via


::selection

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

Syntax

::selection { sRules }

Possible values

sRules

String that specifies one or more Cascading Style Sheets (CSS) attribute/value pairs.

Remarks

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. This pseudo-element can be applied to the color and background-color properties.

Standards information

This pseudo-class is defined in CSS Selectors Level 3 Gg721797.xtlink_newWindow(en-us,Expression.40).png.

Applies to

color, background-color

See also

Concepts

::after
::before
::first-letter
::first-line

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.