In this course, you learned to:
- Link one stylesheet to your pages, choose colors that pass a contrast check, and size text in rem.
- Select exactly the elements you mean, by class, by their place in the tree, and by their state.
- Predict which rule wins when several match, and fix one that loses by changing a selector.
- Let text styles inherit, keep colors in custom properties, and find out in DevTools why a rule doesn’t apply.
- Style a whole site from one linked stylesheet.
Rosa’s site for the Elm Street Community Garden is styled now. All three pages link one stylesheet, style.css. The text is dark green on honeydew, sized in rem. The Tab key steps through the menu, and each page’s own link is bold. On the plots page, every other row is shaded, and the free plot wins over its stripe. Every color comes from tokens in one place, and you fixed the volunteer’s three rules without !important.
Things to Remember
- CSS fails silently. Look for the warning icon.
- Check contrast in the color picker, not by eye.
- Specificity comes before order. Order only breaks a tie.
- Set text styles once on
body, and let them inherit. - When a rule doesn’t apply, ask DevTools: does it match, did it lose, is it invalid, or does it do nothing here?