www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
CSS Selectors

This section contains a list of selectors available for Cascading Style Sheets (CSS).

Selectors

Class Selector

Matches the class attribute of the specified element.

Equality [=] Attribute Selector

Exactly matches the specified attribute value.

Existence [] Attribute Selector

Matches the attribute, whatever its value.

Hyphen [|=] Attribute Selector

Matches any attribute value that is exactly equal, or optionally, followed by a hyphen.

ID Selector

Matches the id attribute of the specified element.

Prefix [^=] Attribute Selector

Matches the specified prefix of an attribute value.

Substring [*=] Attribute Selector

Matches the specified substring of an attribute value.

Suffix [$=] Attribute Selector

Matches the specified suffix of an attribute value.

Type Selector

Matches any element of the specified type.

Universal (*) Selector

Matches any element type.

Whitespace [~=] Attribute Selector

Exactly matches the specified attribute value in a space-delimited list of values.

Pseudo-classes

:active

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

:after

Defines generated content that appears after an element.

:before

Defines generated content that appears before an element.

:first-child

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

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

:link

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

:visited

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

Pseudo-elements

:first-letter

Applies one or more styles to the first letter of the object.

:first-line

Applies one or more styles to the first line of the object.

Combinators

Adjacent Sibling (+) Combinator

Specifies an adjacent sibling relationship between selector elements.

Child (>) Combinator

Specifies a direct descendant relationship between selector elements.

Descendant Combinator

Specifies an arbitrary ancestral relationship between selector elements.

General Sibling (~) Combinator

Specifies a general sibling relationship between selector elements.

Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG