Welcome to Styling Pages With CSS: Selectors, the Cascade, and Inheritance! You’ve probably pasted CSS until a page looked right. This course shows you which rule wins, and why.
Rosa’s site for the Elm Street Community Garden is finished HTML with no CSS yet. In the project, its three pages share one stylesheet that you write. The menu marks the current page, and the plots table gets stripes. Then, in DevTools, you fix a volunteer’s three broken rules.
By the end of this course, you’ll be able 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.
Custom properties are CSS’s variables.
Before You Start
You need to program in some language and know how an HTML page is put together. No CSS is required. You also need:
- A current version of Chrome or Edge
- An editor with a live preview
You built the garden site in the path’s first course. If you’re starting here, the first lesson gives you its starter garden/ folder.
How the Course Works
Each section mixes text lessons, short videos, and exercises you write in the browser, with automated tests. The project styles Rosa’s site in four steps. You explain your stylesheet to the mentor, the AI chat you can open from every lesson. A quiz wraps up the course.
First up: Link Your First Stylesheet.