CSS
Style websites with confidence
100% free · no signup to
read 36 chapters Programming language
Created
1996 by Håkon Wium Lie
Type
Stylesheet language
Pairs with
HTML (structure) + JS (behaviour)
Current version
CSS3 (modular since 2011)
Used by
Every website on the internet
Key concept
Cascading specificity
File extension
.css
Best for
Styling web pages
What is CSS?
CSS (Cascading Style Sheets) controls how HTML elements look — colours, fonts, spacing, layout, animations, and responsive design. It's the presentation layer of every website.
Why CSS?
Without CSS, every web page looks like plain black text on a white background. CSS lets you create beautiful, responsive, branded interfaces.
| Feature | CSS | Inline styles | CSS-in-JS |
|---|---|---|---|
| Reusability | ✅ Classes, IDs | ❌ One element at a time | ✅ Component-scoped |
| Maintainability | ✅ Separate file | ❌ Scattered in HTML | ⚠️ Mixed with JS |
| Performance | ✅ Cached by browser | ❌ Re-downloaded per page | ⚠️ Runtime overhead |
| Responsive design | ✅ Media queries | ❌ Impossible | ⚠️ Possible |
What you'll learn
| Chapter | What you'll know |
|---|---|
| Introduction | What CSS is and how it works |
| Syntax | Rules, properties, values |
| Selectors | Targeting elements precisely |
| Colors | Hex, RGB, HSL, opacity |
| Box Model | Padding, borders, margins |
| Try It | Live editor to experiment |
Start with introduction.
Course chapters
1 CSS Introduction Up next2 CSS Syntax 3 CSS How To — Three Ways to Add CSS 4 CSS Comments 5 CSS Selectors 6 CSS Combinators 7 CSS Pseudo-classes 8 CSS Pseudo-elements 9 CSS Colors 10 CSS Backgrounds 11 CSS Borders 12 CSS Margin 13 CSS Padding 14 The CSS Box Model 15 CSS Outline 16 CSS Text 17 CSS Fonts 18 CSS Links 19 CSS Lists 20 CSS Tables 21 CSS Units 22 CSS Specificity & !important 23 CSS Display 24 CSS Position 25 CSS Z-index 26 CSS Overflow 27 CSS Float and Clear 28 CSS Inline-block 29 CSS Align — Centering Things 30 CSS Opacity 31 CSS Flexbox 32 CSS Grid 33 CSS Responsive Design & Media Queries 34 CSS Transitions & Animations 35 CSS Variables (Custom Properties) 36 Try It Yourself