selectors
Selectors are patterns used to identify elements in a document to which CSS rules apply. In CSS, a selector matches elements in the document tree and determines which elements a rule should style. They can target elements by type (div, p), by class (.note), by id (#header), by attribute (input[type="text"]), or by relationship in the document structure or state (a:hover, li:first-child).
Common selector types include the universal selector (*) that matches all elements, type selectors, class selectors, and
Specificity and cascade govern how styles are applied. Specificity is determined by a four-part score: inline
Practical guidance emphasizes efficiency: avoid overly broad universal selectors or deep descendant chains, and prefer meaningful