Selector | Example | Description |
---|---|---|
Class Selector | .example |
Selects all elements with the class "example". |
ID Selector | #example |
Selects the element with the ID "example". |
Element Selector | p |
Selects all <p> elements. |
Universal Selector | * |
Selects all elements. |
Attribute Selector | [type="text"] |
Selects all input elements with the type "text". |
Pseudo-class Selector | a:hover |
Selects a link when the mouse is over it. |