How much, and what colour?
Every colour and size in CSS needs a value. Knowing which colour format and which unit to pick makes designs consistent — and makes pages adapt to the reader's own settings.
Colours
- px — fixed pixels. Fine for borders and small details.
- rem — relative to the root font size (usually 16px). Use rem for font sizes so text respects the reader's browser settings.
- em — relative to the current element's font size.
- % — relative to the parent. vw / vh — % of the viewport width / height.
Keep enough contrast between text and background (at least 4.5 : 1 for normal text) so everyone can read it.