Loading video player…

Selectors, the Cascade, and Inheritance (Overview)

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.

Download

Course Slides (.pdf)

771.8 KB
Download

Sample Code (.zip)

23.3 KB

00:00 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.

00:14 Here’s a first taste: Rosa’s garden site, finished HTML with no CSS. And here’s the same page, styled.

00:25 The site’s three pages share one stylesheet you write. The menu marks the current page, and the plots table gets stripes.

00:33 In DevTools, you fix a volunteer’s three broken rules.

00:39 You’ll learn to link one stylesheet to your pages, choose colors that pass a contrast check, and size text in rem. To select exactly the elements you mean, by class, by their place in the tree, and by their state.

00:54 To predict which rule wins when several match, and fix one that loses by changing a selector. To let text styles inherit, keep colors in custom properties, and find out in DevTools why a rule doesn’t apply.

01:08 And to style a whole site from one linked stylesheet.

01:14 You need to program in some language and know how an HTML page is put together. No CSS required. You need Chrome or Edge and an editor with a live preview.

01:25 You built the garden site in the path’s first course. If you’re starting here, the first lesson gives you its starter folder.

01:33 Each section mixes text lessons, short videos, and browser exercises with automated tests. The project styles Rosa’s site in four steps. You explain your stylesheet to the mentor, the AI chat in every lesson.

01:48 A quiz wraps up. First up: Link Your First Stylesheet.

Become a Member to join the conversation.