Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Pseudo-classes

This section contains reference topics for all supported Cascading Style Sheets (CSS) pseudo-classes.

In this section

TopicDescription

:active

Sets the style of an element when it is engaged or active.

:checked

Applies one or more styles to the form control element that is selected.

:disabled

Applies one or more styles to the form control element that is disabled.

:empty

Applies one or more styles to the element that has no child elements (including text nodes).

:enabled

Applies one or more styles to the form control element that is enabled.

:first-child

Applies one or more styles to any element that is the first child of its parent.

:first-of-type

Applies one or more styles to the element that is the first sibling element of its type.

:focus

Sets the style of an element when it gains focus.

:hover

Sets the style of an element when the user hovers the mouse pointer over the element.

:indeterminate

Applies one or more styles to radio buttons and check boxes whose toggle states cannot be determined—they are neither checked (selected) nor unchecked (cleared).

:in-range

Applies one or more styles to specified input fields when the fields are in range.

:invalid

Applies one or more styles to specified input fields when the fields are invalid.

:lang(C)

In a document, selects the elements that are in a given language.

:last-child

Applies one or more styles to the element that is the last child element of its parent element.

:last-of-type

Applies one or more styles to the element that is the last sibling element of its type.

:link

Sets the style of an a element when the link has not been visited recently.

:-ms-input-placeholder

Applies one or more styles to placeholder text in an input element.

:-ms-keyboard-active

Applies one or more styles to an element when it has focus and the user presses the space bar.

:not(s)

Applies one or more styles to elements that do not match the simple selector s.

:nth-child(n)

Applies one or more styles to the element that is the n-th child of its parent element.

:nth-last-child(n)

Applies one or more styles to the element that is the n-th child of its parent element, counting from the last one.

:nth-last-of-type(n)

Applies one or more styles to the element that is the n-th sibling of its type, counting from the last one.

:nth-of-type(n)

Applies one or more styles to the element that is the n-th sibling of its type.

:only-child

Applies one or more styles to the element that is the only child element of its parent.

:only-of-type

Applies one or more styles to the element that is the only sibling element of its type.

:optional

Applies one or more styles to specified input fields when the fields are optional.

:out-of-range

Applies one or more styles to specified input fields when the fields are out of range.

:read-only

Applies one or more styles to specified input fields when the fields are read-only.

:read-write

Applies one or more styles to specified input fields when the fields are editable.

:required

Applies one or more styles to specified input fields when the fields are required.

:root

Applies one or more styles to the element that is the root element of the document.

:target

Applies one or more styles to the target element of the referring Uniform Resource Identifier (URI).

:valid

Applies one or more styles to specified input fields when the fields are valid.

:visited

Specifies the style of an a element if the link has been visited recently.

 

 

 

Show:
© 2017 Microsoft