Lesson PackCreated by the roadmap.sh team

CSS Fundamentals

Style, lay out, and debug real pages without fighting the cascade.

20Lessons6Projects2.9 hours read

What's Inside

  1. 01

    Introduction to CSS

    Learn what CSS does and how it connects to HTML

    8 mins
  2. 02

    Selectors and style rules

    Use selectors to target elements clearly

    9 mins
  3. 03

    Text, colors, and backgrounds

    Style readable text, colors, and backgrounds

    8 mins
  4. 04

    The box model

    Understand content, padding, borders, and margin

    6 mins
  5. 05

    Sizing, borders, and rounded corners

    Control box sizes, borders, radius, and shadows

    8 mins
  6. 06

    Spacing with margin, padding, and gap

    Choose margin, padding, or gap for spacing

    6 mins
  7. 07

    Cascade, specificity, and inheritance

    Understand why one CSS declaration wins

    10 mins
  8. 08

    Debugging CSS with DevTools

    Debug CSS problems with browser DevTools

    8 mins
  9. 09

    Block, inline, and display

    Control block, inline, and display behavior

    8 mins
  10. 10

    Images, media, and backgrounds

    Fit images, media, and backgrounds into boxes

    9 mins
  11. 11

    Links, buttons, and states

    Style links, buttons, and interaction states

    10 mins
  12. 12

    Flexbox layout

    Arrange rows, columns, and gaps with Flexbox

    9 mins
  13. 13

    Grid layout

    Build two-dimensional layouts with CSS Grid

    8 mins
  14. 14

    Responsive design

    Make layouts adapt across screen sizes

    8 mins
  15. 15

    Container queries

    Adapt components based on container size

    9 mins
  16. 16

    Positioning and layers

    Position elements without breaking layout

    10 mins
  17. 17

    Overflow and scrolling

    Handle clipped, scrolling, and overflowing content

    10 mins
  18. 18

    Styling forms

    Style form controls, labels, errors, and states

    11 mins
  19. 19

    Modern selectors

    Use modern selectors without extra classes

    10 mins
  20. 20

    CSS variables and organization

    Organize reusable values with CSS variables

    9 mins

What you'll learn

  • Connect CSS to HTML using stylesheets, selectors, rules, classes, and practical naming habits
  • Style readable pages with fonts, colors, backgrounds, spacing, borders, sizing, images, and media
  • Reason about the cascade, specificity, inheritance, display, and DevTools when CSS does not behave as expected
  • Build common layouts with Flexbox, Grid, responsive media queries, container queries, positioning, overflow, and forms
  • Use modern selectors, CSS variables, and organization habits that keep stylesheets easier to read and change

Meet the Author

Kamran Ahmed

Kamran is the founder of roadmap.sh and works on it full-time. Over the past decade he's shipped across startups and scale-ups, with most of his work in open source, he's a Google Developer Expert, a GitHub Star, and the second-most-starred developer on GitHub globally.

What are Lesson Packs?

Lesson packs are premium, opinionated guides written by the team. Pro members get access to all current and future lesson packs, including other pro benefits.

  • Written by the team behind roadmap.sh
  • Visual — diagrams and worked examples
  • A clear, opinionated path per roadmap
  • Unlocks every current and future pack

RoadmapsGuidesFAQsYouTube

roadmap.shby@nilbuild

Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.

© roadmap.sh·Terms·Privacy·

ThewNewStack

The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.