Styling & Layout

Selector Matching (Right-to-Left)

Browsers match CSS selectors right to left, starting from the rightmost 'key' selector. Rejecting non-matching elements early is far faster than searching left to right.

For `.nav li a`, it starts at every <a>, then walks up checking ancestors.

.navlia
start at the rightmost part
Selectors match right to left

Tap the example to replay it · press and hold to slow it down

One of 40 cards in javascript flashcards. Browse every card.