CSS Selector First Child, Last of Type, Even/Odd and :not() Explained
Use a CSS selector first child rule, last-of-type, even and odd striping and :not() correctly by testing each one on a real list and table.
Use a CSS selector first child rule, last-of-type, even and odd striping and :not() correctly by testing each one on a real list and table.
CSS descendant selector basics: learn how descendant, child and sibling combinators match nested elements, and test each rule in a live preview.
A CSS class selector styles reusable elements, while an ID targets one unique element. Try both on a small page with a live preview.
A rule written as :where(#content) a can match a link and still lose to footer a. This guide scores both selectors, explains why order and !important are the wrong first fixes, and shows how to test the result.
A single space separates .menu :focus from .menu:focus, and a text based minifier can quietly remove it. See exactly which element each selector matches, reproduce the change with a small test page, and fix it without losing keyboard focus visibility.