Change colors and sizes, and learn how CSS handles mistakes.
Paint itTry itA CSS rule = a selector (h1) + curly braces + property: value; lines.
The stubborn headingDebugCSS ignores what it does not understand, silently. Typos are easy to miss.
2. Selectors
Pick exactly which elements to style, and find out why your style sometimes does not win.
Style only some elementsExerciseA class in HTML is class="name"; in CSS it is .name. One class can style many elements.
The rule that matches nothingDebugWhen a style does nothing, check the selector first: dot for classes, hash for ids.
Classes and idsExercise#id picks the one element with that id. .class picks every element with that class.
React to the mouseExercise:hover is a pseudo-class: a rule that applies only in a certain situation. Great for buttons and links.
Why is my style ignored?DebugSpecificity decides: id beats class beats tag. Prefer classes: they are easy to override.
Quick checkQuizTag, .class, #id and :hover: four selectors that cover most of the styling you will do.
3. The Box Model
Every element is a box. Learn margin, padding and borders with an interactive diagram.
Space inside the boxExercisepadding is space inside the box. The background color also covers the padding.
Space outside the boxExercisemargin is space outside the box. Padding is inside, margin is outside.
A border around itExerciseborder: width style color; is a shortcut for three properties at once.
Why is my box too wide?ExerciseMost developers start every stylesheet with * { box-sizing: border-box; }, so widths mean what they say.
The number without a unitDebugLengths need a unit. A property that does nothing often has an invalid value.
Quick checkQuizContent, padding, border, margin: the four layers of every box.
4. Colors, Fonts & Effects
Hex colors, Google Fonts, gradients and soft shadows.
Many ways to write a colorExerciseHex is the most common. In hsl, the first number is the hue (0 to 360), which makes it easy to pick a related shade.
Fonts and textExerciseA line-height of 1.5 to 1.7 makes paragraphs much easier to read. Web fonts (like Google Fonts) add more choices later.
A gradient backgroundExerciseChange the angle (45deg, 180deg) to change the direction. You can add more colors, separated by commas.
Soft corners and shadowsExerciseRounded corners and soft shadows make a page feel modern. Keep shadows subtle.
Quick checkQuizA few well-chosen colors, one or two fonts and subtle shadows already look professional.
5. Layout
Line things up with Flexbox and Grid using small visual puzzles.
Side by side with FlexboxExerciseFlexbox is about a parent and its children. Turn it on with display: flex on the parent.
Puzzle: center itExerciseCentering in CSS: display: flex; justify-content: center; align-items: center;. Remember it, you will use it all the time.
Puzzle: a spread-out menuExercisejustify-content has many values: flex-start, center, flex-end, space-between, space-around. Try them all.
The layout that will not flexDebugWhen a layout does not respond, check the exact spelling of the value. Use the browser tools later to see ignored rules.
A grid of tilesExercise1fr means "one share of the free space". repeat(3, 1fr) is three equal columns. Use Flexbox for one direction, Grid for two.
Quick checkQuizFlexbox for rows or columns of things, Grid for tables of things. Together they cover almost every layout.
6. Responsive & Motion
Make pages work on phones, then make things move.
A style for small screensExerciseMedia queries make one page fit every screen. Write the normal styles first, then adjust for small screens.
Smooth changesExercisePut transition on the element itself. It then animates any change, in both directions.
Make it pulseExercise@keyframes is the script, animation is the play button. Use motion gently: it should guide attention, not steal it.
Quick checkQuizResponsive design and gentle motion are what make a site feel finished.
7. Project: Style Your Page
Take your All About Me page from the HTML course and give it a professional look.
Stage 1: the basicsExerciseStyle the big parts first: the page, the header, the content column.
Stage 2: the cardsExercisePadding, radius and shadow: the recipe for a card. You will see it on nearly every website.
Stage 3: polishExerciseYou used selectors, the box model, colors, layout, transitions and media queries together. That is real front-end work.
8. CSS exam
Ten questions about everything in this course. Pass with 8 right answers.
The CSS examExamSelectors, the box model, colors, layout, responsive design and motion: you can style anything.
9. Final project
Take a plain page and design it into a real site of your own: layout, cards, colors, hover and phones. Then send it for review.
Design a landing pageFinal projectLayout, the box model, color, interaction and responsive design together make a professional page.
How the course works
You learn by doing: each lesson explains one idea, then you write real code in the editor and see the result right away. The first lesson is free to try without an account; sign up to save your progress and continue.
Try it
Change working code and see the result immediately.
Exercise
Complete a task. A checklist confirms each requirement as you type.
Debug
Fix code that is broken on purpose, and learn why it failed.