1. CSS1-defined selectors
| Selector | Selector
type |
Description |
| E |
Type Selector |
Select an element of the specified type |
| E#id |
ID Selector |
Select the element that matches E, and the ID of the matching element is "id" and the e-selector can be omitted. |
| E.class |
Class Selector |
Select the element that matches E, and the class attribute value of the matching element is "class", and the E-selector can be omitted. |
| E F |
Include selector |
Select the element that matches F, and the element is contained within the element that matches E. |
| E:link |
Link Pseudo class Selector |
Select the element that matches E, and the matching element is defined and the hyperlink is not accessed. Example: A:link |
| e:visited |
Link Pseudo class Selector |
Select the element that matches E, and the matching element is defined with a hyperlink and has been accessed. Example: a:visited |
| E:active |
User Action Pseudo-class selector |
Select the element that matches E, and the matching element is activated |
| E:hover |
User Action Pseudo-class selector |
Select the element that matches E, and the matching element is being passed by the mouse |
| E:focus |
User Action Pseudo-class selector |
Select the element that matches E, and the matching element gets the focus |
| E::first-line |
Pseudo element Selector |
Select match the first line of text within the E element |
| E::first-letter |
Pseudo element Selector |
Select to match the first character within the E element |
2. CSS2-Defined selectors
| Selector | Selector
type |
Description |
| * |
A wildcard selector |
Select all elements in a document |
| E[foo] |
Property Selector |
Select the element that matches E, and the element defines the Foo attribute. The e-selector can be omitted to indicate that any type of element that defines the Foo attribute is selected. |
| E[foo= "Bar"] |
Property Selector |
Select the element that matches E, and the element Foo property value is "Bar" |
| E[foo~= "Bar"] |
Property Selector |
Select the element that matches E, and the element defines the Foo attribute, and the Foo property value is a space-delimited list with the value "bar" for one list, and the E-selector to omit. |
| E[foo!= "en"] |
Property Selector |
Select the element that matches E, and the element defines the Foo attribute, and the Foo property value is a list separated by a hyphen (-) with the value starting with "en". |
| E:first-child |
Structure pseudo-Class selector |
Select the element that matches E, and the element is the first child of the parent element |
| E::before |
Pseudo element Selector |
Insert content before the element that matches E |
| E::after |
Pseudo element Selector |
Insert content after the element that matches E |
| E > F |
Child contains selectors |
Select the element that matches F, and the element is the child element of the matched e element. |
| E + F |
Adjacent sibling selector |
Select the element that matches F, and the element is the adjacent position following the E element. |
3. CSS3 new Property Selector
| Selector | Selector
type |
Description |
| E[foo^= "Bar"] |
Property Selector |
Select the element that matches E, and the element defines the Foo attribute, and the Foo attribute value starts with "bar". The e-selector can be omitted to indicate that an element of any type can be matched. |
| E[foo$= "Bar"] |
Property Selector |
Select the element that matches E, and the element defines the Foo attribute, and the Foo attribute value ends with "bar". The e-selector can be omitted to indicate that an element of any type can be matched. |
| E[foo*= "Bar"] |
Property Selector |
Select the element that matches E, and the element defines the Foo attribute, and the Foo property value contains "bar". The e-selector can be omitted to indicate that an element of any type can be matched. |
CSS series: CSS3 new Selector