TetSharing

CSS tutorial

The language that gives web pages color, spacing and layout. 12 short chapters, one idea each, every example runnable in the page.

Who it's for: Beginners who know a little HTML and want pages that look designed, plus developers who need Flexbox and Grid explained plainly.

Prerequisites: The first few HTML chapters. Every example renders in a sandboxed preview below the editor.

Start with chapter 1 →

A tidy desk with a laptop and a large external monitor
Photo: domenicoloia on Unsplash

How this track works

Each chapter covers one CSS idea and ends with a live example: edit the styles, press Run, and the page renders in a sandboxed preview. Most examples finish with a line or two printed by a tiny script that asks the browser what it actually computed (a color, a width, a line height), so you can check your understanding against the real result instead of eyeballing it. Our build runs every example in Chromium and compares that text with what the page shows.

The order follows how stylesheets are written in practice: rules and selectors, then the cascade that settles conflicts, then color, units, the box model and type, and finally layout with Flexbox and Grid, responsive media queries, variables and transitions. Explanations cite the W3C CSS specifications.

All 12 chapters

  1. 01Get started
  2. 02Selectors
  3. 03Cascade and specificity
  4. 04Colors
  5. 05Units and sizes
  6. 06Box model
  7. 07Text and fonts
  8. 08Flexbox
  9. 09Grid layout
  10. 10Media queries
  11. 11Custom properties
  12. 12Transitions
Close-up of colorful source code on a dark monitor
Photo: cdr6934 on Unsplash
A laptop with a text editor open on a desk beside a coffee mug and plants
Photo: dkomow on Unsplash

Practice and reference

Final CSS quiz (12 questions)Cheat sheet: css selectorsOfficial CSS documentation