CSS tutorial

Style your pages with colour, spacing and layout

About this tutorial

CSS controls how HTML looks: colours, fonts, spacing and layout. In this beginner class you learn selectors, colours, text, the box model, Flexbox, Grid and responsive design, then style the profile page you built in the HTML class.

Every lesson has live examples, an exercise and a short quiz. Finish with the final quiz.

Lessons

CSS basics

  1. Adding style to a pageWhat CSS is, how a rule is written, and the three ways to add CSS to a page. Free 11 min
  2. Selectors in depthTarget exactly the elements you want with type, class, id, group, descendant and pseudo-class selectors. Free 9 min
  3. Colours and backgroundsWrite colours as names, hex, rgb and hsl, and use background colours, images and gradients. Locked 11 min

Text and boxes

  1. Fonts and textChoose fonts, sizes, weights, line spacing and alignment for readable text. Locked 13 min
  2. The box modelContent, padding, border and margin: how every element takes up space. Locked 9 min
  3. Borders, shadows and rounded cornersFinish boxes with borders, border-radius, box-shadow and outlines. Locked 12 min
  4. Units and sizingChoose between px, %, em, rem, vw and vh, and control size with min and max. Locked 4 min

Layout

  1. Display and positioningUnderstand block, inline and inline-block, and move elements with relative, absolute, fixed and sticky positioning. Locked 6 min
  2. FlexboxLine items up in a row or column, space them out and centre them with Flexbox. Locked 14 min
  3. CSS GridBuild two-dimensional layouts and card grids with rows and columns. Locked 16 min
  4. Responsive design and media queriesMake pages work on phones, tablets and laptops with fluid layouts and media queries. Locked 12 min

Polish and project

  1. Transitions, transforms and hover effectsAdd smooth, subtle movement with transition, transform and simple animations. Locked 13 min
  2. Project: style your profile pageUse everything from the class to turn the HTML profile page into a polished, responsive site. Locked 22 min
  3. CSS final quizTwelve questions covering the whole CSS beginner class. Score yourself before moving on to JavaScript. Locked 5 min
Hi there! đź‘‹ Have a question about the courses or joining the class? Ask me.