A basic selector:
- takes an element in a tree structure
- and tests whether the element matches the selector or not.
selector can be grouped.
This language consists of predicates expression that filter / select elements by:
See Selector Overview.
|The actual / context element
|An element of type E
|An E element with ID equal to myid
|Any element with ID equal to myid (equivalent to *#myid)
|An E element with a foo attribute
|An E element whose foo attribute value is exactly equal to bar
- Pseudo Selector/Class ?
To validate your selector on a HTML page, you can use the devtool
Example with A chrome cheatsheet: