All languages
CSS programming language logo

CSS

Style the web

CSS (Cascading Style Sheets) controls how every HTML element looks: colour, size, position, animation. It is what turns a plain document into a polished web page.

Chapters

  1. 1CSS rules and presentation
  2. 2Connect a stylesheet to HTML
  3. 3Selectors and declarations
  4. 4Custom properties and fallbacks
  5. 5Lengths, percentages and colour
  6. 6Calculations and bounded sizes
  7. 7Media queries and user preferences
  8. 8Repeated styling with selectors
  9. 9Built-in value functions
  10. 10Flexbox for one-dimensional layout
  11. 11Generated content and pseudo-elements
  12. 12The box model
  13. 13The cascade and debugging
  14. 14Reusable styles and organisation
  15. 15Focus, hover and form states
  16. 16Grid, spacing and responsive reference
  17. 17Build and test a study layout

What this CSS course covers

CSS (Cascading Style Sheets) controls how every HTML element looks: colour, size, position, animation. It is what turns a plain document into a polished web page. The 17 chapters combine explanations, examples and practice tasks. HTML and CSS use a browser preview; SQL examples target SQLite; console languages use their compiler or runtime. Read each example's prerequisites rather than combining independent snippets into one program.

CSS decides how a page looks: colour, spacing, typography, layout and motion. This online CSS playground pairs your stylesheet with sample markup and renders the result instantly, which makes it the quickest way to build intuition for the box model, Flexbox and Grid.

How to study CSS so it sticks

  1. Read the chapter once without touching the keyboard

    Get the shape of the idea first. Stopping every line to type breaks the explanation into fragments you then have to reassemble.

  2. Retype every example from scratch

    Do not copy and paste. Typing forces you to notice punctuation, indentation and the order things happen in — the three things beginners lose marks and hours on.

  3. Break it on purpose

    Delete a semicolon, misspell a variable, remove a bracket. Read the error carefully. You are building a mental index of error messages, which is most of what practical debugging is.

  4. Write one tiny program of your own

    One idea, five to fifteen lines: a converter, a counter, a grader, a mini quiz. Original code that works teaches more than a hundred lines you followed along with.

  5. Come back the next day and redo it from memory

    Spaced recall is the difference between finishing a course and keeping it. Five minutes of yesterday's example before today's chapter is enough.

Why CSS is worth your time

CSS controls everything a visitor actually sees, and layout skills transfer directly to every framework and design system.

Modern CSS handles responsive layout, theming and animation natively, so a lot of what once needed JavaScript is now a few declarations.

Where CSS is used

  • →Responsive website and app layouts
  • →Design systems and component libraries
  • →Animations and interaction polish
  • →Dark mode and theming

Mistakes CSS beginners hit first

My rule is ignored

Why: A more specific selector wins, or the property is misspelled.

Fix: Raise specificity (or reorder the rules) and check the spelling — invalid properties are silently dropped.

Margins collapse unexpectedly

Why: Adjacent vertical margins merge into the larger one.

Fix: Use padding on the parent, or make the parent a flex container.

The element ignores width

Why: It is an inline element.

Fix: Set display: block or inline-block before applying width.

CSS course FAQs

What will I be able to build after the CSS course?

Style a document using selectors, the box model, Flexbox, Grid and media queries. Explain which declarations win in the cascade and test keyboard focus and narrow layouts.

Do I need any experience before starting CSS?

No. Chapter one assumes you have never written a line of code. If you have programmed before, skim the first four chapters and start at the loops and functions section instead.

How much time should I spend per CSS chapter?

Around 20 minutes reading and 20 minutes retyping and experimenting. The retyping matters more than the reading, because recall — not recognition — is what you need when you write code yourself.

Can I run the CSS examples without installing anything?

Yes. Every chapter includes an editor with a run button, and there is a dedicated CSS compiler page with tutorials and practice exercises with worked solutions.

Practise CSS while you read