Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Web development

CSS

CSS from the first rule to production: selectors, the cascade, the box model, flexbox and grid, responsive design, colour, type, motion, Sass and Tailwind.

71 lessons to read 21 modules

71 lessons: 11 free, 43 free with Pro answers and 17 with a free core.

Examples run with Node.js 24.21.0.

Who it is for

Web learners, designers and front-end developers who struggle with layout.

What you will be able to do

  • Explain how a browser parses, matches, cascades and lays out CSS, and inspect each step in DevTools
  • Write selectors and predict which declaration wins through the cascade, specificity and layers
  • Size and space boxes with the box model, modern units and math functions
  • Build layouts with normal flow, positioning, flexbox and grid
  • Make pages responsive with media queries, container queries and fluid type
  • Style colour, text and themes, including dark mode, Indic scripts such as Devanagari, and right-to-left text
  • Organise stylesheets with custom properties, nesting, @scope and cascade layers
  • Add motion with transitions, animations and view transitions that respect user preferences
  • Use Sass, Bootstrap 5.3 and Tailwind CSS 4, and know when native CSS is enough
  • Check browser support with Baseline, then debug, speed up and test CSS for accessibility

Revise and practise

Modules and lessons

What the labels mean

Free
the whole lesson and every answer in it
Free lesson, Pro answers
the whole lesson is free; the model answers to its interview questions open with a pass
Free core, Pro depth
the core of the lesson is free; its in-depth parts open with a pass
Pro
opens with a Pro, Premium or Ultimate pass

Minutes are reading time: “10 of 25 min free” means 10 minutes of the lesson are free.

What a pass opens in this track

34 in-depth parts and 138 interview answers. The same pass opens every other track and every Pro tool.

  1. Module 1

    How CSS works

    How a browser turns CSS into pixels, the parts of a rule, linking stylesheets and browser defaults, inspecting CSS in DevTools, and reading Baseline support.

    1. How browsers apply CSS to a page Beginner Free lesson, Pro answers: 20 minutes
    2. Adding CSS to HTML and browser default styles Beginner Free core, Pro depth: 10 of 25 minutes free
    3. Inspecting CSS with browser DevTools Beginner Free core, Pro depth: 8 of 25 minutes free
    4. CSS browser support: Baseline and the Snapshot Beginner Free core, Pro depth: 7 of 20 minutes free
  2. Module 2

    Selectors

    Type, class, ID and attribute selectors, combinators, pseudo-classes for state and structure, :is(), :where(), :not() and :has(), and pseudo-elements.

    1. Type, class, ID, attribute and combinators Beginner Free lesson, Pro answers: 30 minutes
    2. Pseudo-classes for state and structure Beginner Free core, Pro depth: 8 of 30 minutes free
    3. :is(), :where(), :not() and :has() Intermediate Free core, Pro depth: 11 of 30 minutes free
    4. Pseudo-elements, generated content and counters Beginner Free core, Pro depth: 10 of 30 minutes free
  3. Module 3

    The cascade, specificity and layers

    How the cascade picks one declaration, calculating specificity, inheritance and computed values, and organising styles with cascade layers.

    1. The cascade: which declaration wins Intermediate Free lesson, Pro answers: 35 minutes
    2. Specificity: calculating and controlling it Intermediate Free core, Pro depth: 18 of 35 minutes free
    3. Inheritance, global keywords and computed values Intermediate Free core, Pro depth: 14 of 35 minutes free
    4. Cascade layers with @layer Intermediate Free core, Pro depth: 15 of 35 minutes free
  4. Module 4

    The box model, sizing and overflow

    Content, padding, border and margin, margin collapse and formatting contexts, percentage and intrinsic sizes, aspect ratios, and overflow.

    1. The box model: content, padding, border, margin Beginner Free lesson, Pro answers: 25 minutes
    2. Margin collapse and formatting contexts Intermediate Free core, Pro depth: 7 of 25 minutes free
    3. Sizing: percentages, intrinsic sizes and ratios Intermediate Free core, Pro depth: 9 of 30 minutes free
    4. Overflow, scroll containers and truncation Intermediate Free: 25 minutes
  5. Module 5

    Values, units and math functions

    Absolute and relative lengths, viewport units for mobile browsers, and calc(), min(), max(), clamp() and the newer math functions.

    1. Lengths and units: px, em, rem, ch and lh Beginner Free lesson, Pro answers: 25 minutes
    2. Viewport units: vw, dvh, svh and lvh Intermediate Free core, Pro depth: 8 of 20 minutes free
    3. calc(), min(), max(), clamp() and newer math Intermediate Free core, Pro depth: 9 of 25 minutes free
  6. Module 6

    Colour and theming

    Colour syntax, OKLCH and wide-gamut colour, color-mix() and relative colours, contrast, dark mode, colour schemes and forced colours.

    1. Colour syntax: hex, rgb(), hsl() and keywords Beginner Free lesson, Pro answers: 25 minutes
    2. OKLCH, Oklab and wide-gamut colour Intermediate Free core, Pro depth: 11 of 30 minutes free
    3. color-mix(), relative colour and contrast-color() Intermediate Free core, Pro depth: 9 of 30 minutes free
    4. Dark mode, colour schemes and forced colours Intermediate Free core, Pro depth: 11 of 30 minutes free
  7. Module 8

    Backgrounds, borders, images and effects

    Backgrounds, borders and shadows, gradients and patterns, images, video and SVG in CSS, and filters, blend modes, masks and clipping.

    1. Backgrounds, borders and shadows Beginner Free: 25 minutes
    2. Gradients: linear, radial, conic and patterns Beginner Free lesson, Pro answers: 25 minutes
    3. Images, video and SVG in CSS Beginner Free: 25 minutes
  8. Module 9

    Normal flow, positioning and stacking

    Normal flow and the display property, relative, absolute, fixed and sticky positioning, and stacking contexts with z-index.

    1. Normal flow and the display property Beginner Free: 30 minutes
    2. Positioning: relative, absolute, fixed and sticky Intermediate Free lesson, Pro answers: 30 minutes
    3. Stacking contexts and z-index Intermediate Free lesson, Pro answers: 30 minutes
  9. Module 10

    Flexbox

    Axes, wrapping and gap, how flex items grow and shrink, alignment, auto margins and order, and flexbox patterns for real interfaces.

    1. Flexbox fundamentals: axes, wrapping and gap Beginner Free lesson, Pro answers: 25 minutes
    2. How flex items grow, shrink and size Intermediate Free lesson, Pro answers: 30 minutes
    3. Flex alignment, auto margins and order Intermediate Free lesson, Pro answers: 25 minutes
    4. Flexbox patterns for real interfaces Intermediate Free lesson, Pro answers: 30 minutes
  10. Module 11

    CSS Grid

    Tracks, fr units and placement, named areas and lines, responsive grids with minmax() and auto-fit, subgrid, alignment and overlap.

    1. Grid fundamentals: tracks, fr and placement Beginner Free lesson, Pro answers: 30 minutes
    2. Grid areas and named lines Beginner Free: 25 minutes
    3. Responsive grids: minmax(), auto-fit, auto-fill Intermediate Free lesson, Pro answers: 25 minutes
    4. Subgrid: aligning nested content Intermediate Free lesson, Pro answers: 25 minutes
    5. Grid alignment, overlap and new grid features Intermediate Free lesson, Pro answers: 25 minutes
  11. Module 12

    Responsive design: media and container queries

    Responsive foundations, media queries with range syntax and user preferences, container queries, fluid type and spacing, and intrinsic layouts.

    1. Responsive design foundations Beginner Free lesson, Pro answers: 25 minutes
    2. Media queries: range syntax and user preferences Intermediate Free: 25 minutes
    3. Container queries and container units Intermediate Free: 30 minutes
    4. Fluid typography and spacing scales Intermediate Free lesson, Pro answers: 25 minutes
    5. Layouts that adapt without breakpoints Advanced Free lesson, Pro answers: 35 minutes
  12. Module 13

    International layout: logical properties, writing modes and Indian scripts

    India-specific

    Logical properties for any writing direction, vertical and bidirectional text, and typography for Devanagari and other Indian scripts.

    1. Logical properties for any writing direction Intermediate Free lesson, Pro answers: 25 minutes
    2. Writing modes, vertical and bidirectional text Advanced Free core, Pro depth: 6 of 25 minutes free
    3. Typography for Indian scripts Intermediate Free: 30 minutes
  13. Module 14

    Custom properties, nesting, scope and architecture

    Custom properties and @property, native nesting, @scope and component styles, and naming, structure and design tokens for large stylesheets.

    1. Custom properties (CSS variables) Intermediate Free lesson, Pro answers: 25 minutes
    2. Typed custom properties with @property Advanced Free lesson, Pro answers: 25 minutes
    3. CSS architecture, naming and design tokens Advanced Free lesson, Pro answers: 35 minutes
  14. Module 15

    Feature queries and the newest conditional CSS

    Feature queries and progressive enhancement, container style and state queries, and the newest conditional functions such as if() and attr().

    1. Feature queries and progressive enhancement Intermediate Free lesson, Pro answers: 25 minutes
    2. Container style queries and state queries Advanced Free lesson, Pro answers: 25 minutes
  15. Module 16

    Transitions, animations, scroll and view transitions

    Transitions and @starting-style, keyframe animations, 2D and 3D transforms, scroll snap, scroll-driven animations and view transitions.

    1. Transitions and @starting-style Intermediate Free: 25 minutes
    2. Keyframe animations and smooth motion Intermediate Free lesson, Pro answers: 25 minutes
    3. Transforms: translate, rotate, scale and 3D Intermediate Free lesson, Pro answers: 20 minutes
    4. Scroll snap and scroll-driven animations Advanced Free lesson, Pro answers: 30 minutes
    5. View transitions for pages and components Advanced Free lesson, Pro answers: 30 minutes
  16. Module 17

    Forms, tables, popovers and anchor positioning

    Styling form controls and tables, popovers, dialogs and disclosure widgets, and anchor positioning for tooltips and menus.

    1. Styling forms and form controls Intermediate Free: 30 minutes
    2. Popovers, dialogs and disclosure widgets Intermediate Free: 25 minutes
    3. Anchor positioning for tooltips and menus Advanced Free lesson, Pro answers: 30 minutes
  17. Module 19

    Sass modules, migrating off @import and Sass in production

    @use and @forward, migrating a project off @import, and using Sass in production alongside native CSS features.

    1. Sass modules: @use, @forward and configuration Intermediate Free lesson, Pro answers: 30 minutes
    2. Migrating Sass from @import to modules Advanced Free lesson, Pro answers: 35 minutes
    3. Sass in production and when to use native CSS Advanced Free lesson, Pro answers: 30 minutes
  18. Module 20

    Bootstrap 5.3: grid, utilities, components and JavaScript

    Setting up Bootstrap 5.3, Reboot and colour modes, the grid, utilities and the utility API, components and forms, and its JavaScript plugins.

    1. Bootstrap 5.3: setup, Reboot and colour modes Beginner Free lesson, Pro answers: 25 minutes
    2. The Bootstrap grid: containers, rows and columns Beginner Free lesson, Pro answers: 30 minutes
  19. Module 22

    Utility-first CSS with Tailwind CSS 4

    Utility-first CSS with Tailwind CSS 4, themes, tokens and custom utilities, and responsive design and production builds with Tailwind.

    1. Utility-first CSS with Tailwind CSS v4 Intermediate Free lesson, Pro answers: 30 minutes
  20. Module 23

    Debugging, performance, accessibility, tooling and print

    Debugging CSS step by step, performance and Core Web Vitals, accessible CSS, linters and build tools, and print stylesheets.

    1. Debugging CSS systematically Intermediate Free lesson, Pro answers: 30 minutes
    2. Accessible CSS: focus, motion, contrast and reflow Intermediate Free lesson, Pro answers: 30 minutes
    3. Tooling: stylelint, Lightning CSS, PostCSS and Sass Intermediate Free lesson, Pro answers: 25 minutes
    4. Print stylesheets and paged media Intermediate Free lesson, Pro answers: 20 minutes
  21. Module 24

    Design to code and interview preparation

    Turning a design file into maintainable CSS, and preparing for front-end and CSS interview questions.

    1. From design file to CSS: a build workflow Advanced Free lesson, Pro answers: 35 minutes
    2. CSS interview preparation Intermediate Free lesson, Pro answers: 30 minutes

Related tools

Official documentation

More in Web development

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.