Skip to main content
PProfileMatch

CSS Fundamentals Tutorial

Learn CSS the way it really works: selectors, the box model, flexbox, grid and responsive layouts

Beginner4 lessonsabout 20 min of reading

This course is for people who can write basic HTML and now want their pages to look and behave the way they intend. If you have ever changed a CSS value, seen nothing happen, and added !important out of frustration, the first lesson is written for you. It assumes you have read, or are comfortable with, HTML Fundamentals.

Each lesson pairs a small HTML snippet with the CSS that styles it, and then states precisely what the result looks like, down to pixel sizes where the numbers teach something. You will learn how the browser decides which rule wins, how every element is a set of nested boxes, and how to arrange those boxes in one dimension with flexbox and in two with grid.

The four lessons build on each other: selectors and the cascade explain why rules apply, the box model and normal flow explain how big things are and where they sit by default, flexbox and grid change that default, and media queries make the result adapt to the screen. You will finish able to read a stylesheet, debug it in DevTools, and build a responsive page without a framework.

CSS Fundamentals lessons

  1. 1CSS Selectors, the Cascade and Specificity ExplainedUnderstand CSS selectors, how the cascade picks a winner, how to calculate specificity and inheritance, and how to debug a rule that will not apply.5 min read
  2. 2CSS Box Model and Normal Flow: Margin, Padding, BorderLearn how the CSS box model sizes every element, how box-sizing, margin collapsing and display change layout, and how normal flow positions blocks.5 min read
  3. 3CSS Flexbox Tutorial: Lay Out Rows and Columns With FlexLearn CSS flexbox with working examples: main and cross axis, justify-content, align-items, gap, wrap, flex grow and shrink, and a pinned toolbar layout.5 min read
  4. 4CSS Grid and Responsive Design With Media QueriesLearn CSS Grid with fr units, repeat, minmax and grid areas, then make layouts responsive with a mobile-first approach, media queries and fluid sizing.5 min read

Learning CSS Fundamentals to land a job? Browse open roles or check which skills are trending.