Learn CSS from Scratch

Learn how to style web pages: selectors, the box model, typography, Flexbox, Grid, responsive design, transitions, animations and CSS variables, with live examples you can edit.

9 lessonsBeginnerFreeLive code examples

Start lesson 1 →

What you will learn

  • Style any HTML page with confidence
  • Lay out pages with Flexbox and Grid
  • Make designs work on phones and desktops
  • Add smooth transitions and animations

Course syllabus

  1. What is CSS? Ways to Add CSSLearn what CSS is, how it styles HTML, and the three ways to add CSS: inline, internal and external stylesheets,…
  2. CSS Selectors and SpecificityMaster CSS selectors: element, class, id, descendant, attribute and pseudo-class selectors, and understand how specificity decides which rule wins.
  3. Colors, Units and the Box ModelUnderstand CSS colours, units such as px, em, rem and percent, and the box model: content, padding, border and margin,…
  4. Typography and BackgroundsStyle text and backgrounds with CSS: font-family, font-size, line-height, letter-spacing, gradients and background images.
  5. Display, Position and Z-indexLearn how CSS display, position (static, relative, absolute, fixed, sticky) and z-index control the layout and stacking of elements.
  6. CSS FlexboxLearn CSS Flexbox with examples: flex containers, direction, justify-content, align-items, wrap, gap and building responsive navigation bars.
  7. CSS Grid LayoutLearn CSS Grid: rows and columns, fr units, grid-template-areas, gap and auto-fit for building responsive page layouts.
  8. Responsive Design and Media QueriesMake websites work on phones, tablets and desktops using the viewport meta tag, fluid units, media queries and a mobile-first…
  9. Transitions, Animations and CSS VariablesAdd smooth hover effects with transitions, create keyframe animations, and keep your styles consistent with CSS custom properties.

Other courses