Ch 1 · Styling Basics · CSS
Topic 1 of 3 in CSS — Make It Beautiful — 3 lessons.
Colours & Fonts
CSS controls how HTML looks. A rule is selector { property: value; }. Edit the styles inside <style> and watch the page change live.
Tag, Class & Id Selectors
The selector is the part of a rule before the curly braces. It decides which elements the rule applies to. Picking the right selector means you can style one element, a handful, or every element of a kind.
When Rules Clash
What happens when two rules try to set the same property on one element? CSS settles it with the cascade, a set of tie-break rules. Knowing them saves a lot of confusion when a style seems to refuse to work.