The course
CSS
Learn how CSS attaches to HTML, how a rule is built, how selectors pick exactly the elements you mean, and how the cascade settles conflicts. You finish by setting type that is comfortable to read.
Ready to learnYour path through the ideas
Inside the course
Install your tools, choose your setup and verify a local run.
02Introduction3 lessons
CSS is a language for describing how structured documents are presented, including their layout, typography and color. Meet the café page you will style for the whole course, see why CSS can only style what HTML has named, and learn how the three frontend languages divide the work.
03CSS Basics4 lessons
CSS declarations can be attached inline, embedded in a document or linked in a stylesheet. The cascade resolves competing declarations. Attach styles inline, inside a style element and from an external file, learn when each one fits, and then predict which declaration wins when several target the same element.
04Rules3 lessons
A CSS rule pairs a selector with declarations. The selector chooses elements; each declaration supplies a property and value. Learn the shape of every CSS rule, the kinds of values properties accept, why the browser silently skips mistakes, and how to leave comments that help the next reader.
05Simple Selectors5 lessons
A simple selector matches an element by a characteristic such as its type, class, ID or attribute. Select by element type, class, id and attribute, group selectors with commas, and learn how much weight each kind carries when rules compete.
06Combinator Selectors4 lessons
A combinator joins selectors through a relationship in the document tree, such as ancestry or sibling order. Combine selectors to reach elements through their family relationships: anywhere inside, directly inside, right after and anywhere after.
07Fonts and Text Styling5 lessons
Font properties choose and size glyphs. Text properties control how those glyphs are arranged, spaced and aligned. Choose font stacks and web fonts, size text in units that respect the reader, use weights, styles and the font shorthand safely, then control colour, alignment, line height and spacing.