Intern Track Roadmap

CSS selectors

This course covers CSS selectors, the patterns a browser matches against elements in an HTML page. It starts with how CSS reaches a page and the shape of a rule. It then covers type, class and ID selectors, grouping with commas, and the four combinators. Attribute selectors, pseudo-classes for state and position, and pseudo-elements such as ::before and ::after follow. The last lesson styles an accessible signup form without changing its markup, using each technique in turn.

What you'll learn

  • ✓How CSS rules reach a page and how a rule is structured
  • ✓Type, class and ID selectors and when to use each
  • ✓Grouping selectors and the descendant, child and sibling combinators
  • ✓Attribute selectors for presence, exact and partial matches
  • ✓Pseudo-classes for interaction, form state and sibling position
  • ✓Pseudo-elements for generated content, text slices and placeholders
Free preview · Lesson 1 5 min read

What CSS does: connecting style to HTML

Open any lesson from this series in a browser and you'll notice something: it looks plain. Black text, blue links, a default serif font, form controls in whatever style your operating system ships. That's not a bug in your markup, it's the browser's own built-in stylesheet, the same one every…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...