

Lesson 01 · 10 min
Selectors and the cascade
CSS doesn't "paint a tag". It finds nodes with a rule and argues with other rules.
10 minLesson 1 of 8Practice includedAsk AI on any point
A rule: on the left, who we're looking for; on the right, which properties. .card { color: #111; } means everything with the class card. Specificity: a type is weaker than a class, a class is weaker than an id. Equal strength — whatever comes later in the file wins. !important is almost always a crutch.
*means every element — expensive and noisy. Not as a "just in case" reset.- Descendant
article p— any p inside. Childarticle > p— only direct ones. - Don't mix styles into HTML via
style=""unless it's a five-minute prototype.
Check
Lock it in before you move on
1. What is usually stronger: a class or a tag name?
2. Two classes of equal strength. Who wins?
3.
!importantis