The Basic CSS Parsing

The selectors can be split into a few group and (roughly) sorted from the least to most expensive.

RankTypeExample
1ID#classId
2Class.class
3Tagdiv
4General and adjacent siblingdiv ~ a, div + a
5Child and descendantdiv > a, div a
6Universal*
7Attribute[type="text"]
8Pseudo-classes and elementsa:first-of-type, a:hover