Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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).

: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.

: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.

 

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.