CSS Tutorial
A complete CSS path from beginner to pro - selectors, box model, Flexbox, Grid, responsive design, motion, architecture, and real UI projects.
Curriculum
Work through each section in order. Every lesson ends with practice and key points so the idea sticks.
Getting Started
- 1What is CSS?
Learn what CSS is, how it works with HTML, and why stylesheets matter for every web page.
8 min - 2Ways to Add CSS
Learn the three ways to add CSS to a page: inline styles, internal stylesheets, and external CSS files.
9 min - 3Selectors Basics
Learn how element, class, and ID selectors target HTML so your CSS rules apply to the right parts of a page.
10 min - 4Colors and Units
Learn common CSS color formats and length units so you can set colors, sizes, and spacing with confidence.
10 min - 5Cascade and Specificity Intro
Learn how CSS decides which rule wins when multiple rules target the same element.
11 min
Box Model
- 6The Box Model
Learn the CSS box model: content, padding, border, and margin, and how they build every element on the page.
10 min - 7Margin and Padding
Learn how margin and padding create space inside and outside elements, including shorthand and common layout patterns.
10 min - 8Borders and Outline
Learn how to draw borders and outlines, including width, style, color, radius, and when outline is the better choice.
9 min - 9Width, Height, and max-width
Learn how width, height, min/max constraints, and percentage sizing control element dimensions.
10 min - 10box-sizing
Learn how box-sizing changes whether padding and border are included in an element width and height.
9 min
Typography
- 11Fonts and Text
Learn core typography properties: font-family, font-size, font-weight, and related text styling controls.
10 min - 12Line Height and Spacing
Learn how line-height, letter-spacing, and word-spacing affect readability and rhythm in text blocks.
9 min - 13Align and Decorations
Learn text-align, text-decoration, text-indent, and related properties for alignment and text ornaments.
9 min - 14Web Fonts Intro
Learn how web fonts work at a beginner level, including system fonts, @font-face ideas, and practical loading tips.
10 min
Layout Basics
- 15The display Property
Learn how display controls whether elements behave as block, inline, inline-block, none, flex, and more.
10 min - 16Position Basics
Learn static, relative, absolute, fixed, and sticky positioning, plus top/right/bottom/left offsets.
11 min - 17Flexbox Intro
Learn what flexbox is, how to create a flex container, and how children become flex items.
10 min - 18flex-direction and wrap
Learn how flex-direction and flex-wrap control the direction of the main axis and whether items wrap to new lines.
10 min - 19Justify and Align
Learn justify-content, align-items, and align-self to distribute and align flex items on the main and cross axes.
11 min - 20Gap in Flex Layouts
Learn how the gap property spaces flex items cleanly without margin tricks.
9 min
Practice
- 21Backgrounds
Learn background-color, background-image, size, position, and practical layering basics for surfaces and heroes.
10 min - 22Pseudo-classes (:hover, :focus)
Learn interactive pseudo-classes such as :hover, :focus, and :active to style user interaction states.
10 min - 23Pseudo-elements
Learn ::before, ::after, and other pseudo-elements for decorative content and text fragments.
10 min - 24Mini Project: Card Layout
Build a small responsive card layout that practices the box model, typography, flexbox, and hover states.
14 min - 25Beginner Review
Review the core beginner CSS ideas: cascade, box model, typography, display, positioning, and flexbox.
12 min
Responsive
- 26Responsive Design Intro
Learn why responsive design matters and how fluid layouts, flexible media, and breakpoints work together across screen sizes.
12 min - 27Media Queries
Write media queries that change layout, typography, and component behavior at the right viewport conditions.
13 min - 28Fluid Images and Media
Make images, video, and embedded media scale safely inside responsive layouts without overflow or distortion.
11 min - 29Mobile-First CSS
Write base styles for small screens first, then progressively enhance the layout with min-width media queries.
12 min - 30Container Queries Intro
Style components based on their parent container size instead of only the viewport width.
13 min
Grid
- 31CSS Grid Intro
Understand CSS Grid as a two-dimensional layout system for rows and columns working together.
12 min - 32grid-template-columns/rows
Define grid tracks with fixed sizes, fr units, repeat(), minmax(), and auto-fit patterns.
13 min - 33Grid Template Areas
Name layout regions with grid-template-areas and assign items to those areas for readable page structure.
12 min - 34Gap and Alignment in Grid
Control spacing with gap and align grid items or tracks using justify and align properties.
11 min - 35Grid vs Flexbox
Choose Grid or Flexbox with confidence by comparing one-dimensional and two-dimensional layout needs.
12 min
Visual Design
- 36CSS Variables
Define reusable design tokens with custom properties for color, spacing, type, and theme switches.
12 min - 37Gradients and Shadows
Add depth and atmosphere with linear and radial gradients plus layered box and text shadows.
12 min - 38Transforms
Move, scale, rotate, and skew elements with transform functions for polish and interactive feedback.
11 min - 39Transitions
Animate property changes smoothly over time with transition-property, duration, easing, and delay.
12 min - 40Animations Basics
Build keyframe animations for attention, loading states, and entrance effects with control over timing and iteration.
13 min
Components
- 41Navigation Styles
Style site navigation for desktop and small screens, including flex toolbars and mobile menu patterns.
13 min - 42Buttons and Badges
Build consistent button variants and compact badges with shared tokens, states, and accessible contrast.
11 min - 43Styling Forms
Style labels, inputs, textareas, and focus states so forms are readable, consistent, and keyboard-friendly.
13 min - 44Cards and Lists
Compose card surfaces and structured lists for content collections, dashboards, and feature grids.
12 min - 45prefers-color-scheme
Support light and dark themes with prefers-color-scheme and CSS variables that swap design tokens.
12 min
Projects
- 46Project: Responsive Landing
Build a responsive landing page that combines fluid layout, media queries, visual polish, and reusable components.
18 min - 47Project: Dashboard Layout
Construct a dashboard shell with grid areas, responsive stacking, cards, and a compact toolbar.
18 min - 48Intermediate Review
Review responsive techniques, Grid, visual design tools, and component patterns from the intermediate CSS path.
14 min
Modern CSS
- 49Fluid Sizing with clamp, min, and max
Build responsive type, spacing, and layout values with min(), max(), and clamp() instead of endless media query breakpoints.
16 min - 50Logical Properties
Write direction-aware CSS with inline and block axes so layouts adapt cleanly for left-to-right and right-to-left writing modes.
15 min - 51The :has() Selector
Style a parent based on its children or descendants with :has(), unlocking patterns that once required JavaScript.
16 min - 52Cascade Layers with @layer
Organize cascade priority with @layer so resets, tokens, components, and utilities stop fighting each other.
17 min - 53Native CSS Nesting
Write nested CSS rules natively in the browser, keeping component styles readable without a preprocessor requirement.
15 min
CSS Architecture
- 54BEM Naming
Name CSS classes with Block, Element, Modifier so large stylesheets stay searchable, predictable, and low in specificity.
16 min - 55Utility vs Semantic CSS
Choose when to write semantic component classes and when utility classes are the clearer, faster tool.
15 min - 56Design Tokens in CSS
Centralize color, space, type, and motion decisions as CSS custom properties so themes and products stay consistent.
17 min - 57Accessibility-Friendly CSS
Use CSS to support keyboard users, motion preferences, contrast, focus visibility, and content that remains usable when styles change.
18 min - 58Print Stylesheets
Craft print-ready pages with @media print so articles, invoices, and reports stay readable on paper and PDFs.
14 min
Capstones
- 59Capstone: Mini Design System
Build a compact CSS design system with tokens, layers, base styles, components, and utilities you can reuse across pages.
22 min - 60Capstone: Marketing Page
Compose a polished marketing landing page with fluid type, logical spacing, modern selectors, and your mini design system.
22 min - 61Capstone: App Shell Layout
Build a responsive application shell with sticky header, collapsible navigation, main content, and utility regions.
22 min - 62CSS Performance Tips
Write CSS that stays fast: fewer layout thrash risks, lean selectors, efficient animations, and delivery habits that reduce render delay.
16 min - 63Production CSS Checklist
Run a practical pre-release checklist covering architecture, accessibility, responsiveness, print, and maintainability.
14 min - 64CSS Frameworks Overview
Compare utility-first, component kits, and CSS-in-JS-adjacent approaches so you can choose tools without abandoning core CSS skills.
15 min - 65Next Steps After CSS
Map what to learn next after advanced CSS: deeper layout mastery, design systems, frontend frameworks, and real project practice.
12 min