CSS Fundamentals

10 hours, 40 minutes CC
CSS Fundamentals

Course Description

Build the CSS foundation you need to tackle any frontend project! Learn the essentials of typography, responsive grid layouts, and form styling. Add polish with shadows, animations, and decorative pseudo-elements. By the end, you'll have the confidence to dive into your next vanilla CSS codebase or use utility-first approaches like Tailwind.

This course and others like it are available as part of our Frontend Masters video subscription.

Preview

Course Details

Published: February 6, 2026

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 250+ In-depth courses
  • 24 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops

Table of Contents

Introduction

Section Duration: 12 minutes
  • Introduction
    Kevin Powell introduces the course by guiding students through setting up a project, providing starting HTML files and images, and encouraging them to follow along with the course website for interactive examples and demos.

CSS Essentials

Section Duration: 1 hour, 11 minutes

Typography

Section Duration: 57 minutes

Box Model

Section Duration: 59 minutes
  • Content Box
    Kevin explains the box model, covering content, padding, border, and margin boxes. He demonstrates how block-level elements size themselves by default and emphasizes setting flexible constraints rather than fixed sizes to work with the browser and avoid layout issues.
  • Padding & Border
    Kevin explains padding and borders in CSS, showing how padding adds space inside an element and how to use shorthand and logical properties. He then demonstrates setting border width, style, and color, including shorthand notation and default behavior.
  • Margin
    Kevin discusses margins in CSS, showing how they add space around elements and how to visualize them in the box model. He highlights the difference between padding and margin and the importance of white space in design.
  • Home Page Content Spacing
    Kevin demonstrates how to organize and style homepage content, adding backgrounds, classes, and buttons while covering font, color, padding, hover effects, and the difference between inline and block elements.
  • Default Margin
    Kevin explains default browser margins, the difference between margin and padding, and demonstrates using auto margins and padding to center elements and maintain proper spacing in layouts.
  • Collapsing Margin
    Kevin explains collapsing margins in CSS, demonstrating how touching margins merge and cause unexpected spacing, and shows strategies like using padding to prevent it, while also mentioning future CSS solutions like margin trim.
  • Box Sizing
    Kevin discusses box sizing in CSS, showing how using border-box ensures elements include padding and borders in their size, and discusses when to use content-box for specific cases.

Backgrounds & Images

Section Duration: 34 minutes

CSS Grid Layout

Section Duration: 1 hour, 3 minutes

Flexbox Layout

Section Duration: 55 minutes

Responsive Layouts

Section Duration: 1 hour, 20 minutes
  • What is a Responsive Layout?
    Kevin explains responsive layouts, highlighting fluid grids, flexible images, and media queries, and shows how elements adjust across screen sizes using practical examples.
  • Intrinsic Design Patterns
    Kevin explains intrinsic design patterns, showing how sizing values like auto, min-content, max-content, and fit-content affect layouts. He demonstrates practical examples, including a navigation bar that adjusts to content without fixed measurements.
  • Intrinsic Grids
    Kevin explains intrinsic grids, showing how new rows are added automatically as content grows. He demonstrates using grid-template-columns with repeat, autofit, and minmax for flexible columns, and suggests custom properties to simplify and customize the code.
  • auto-fit vs auto-fill
    Kevin explains auto-fit and auto-fill in CSS Grid, showing how auto-fit creates columns for each element while auto-fill adds columns even if empty. He demonstrates how these settings help grids adapt to content and work with Flex for responsive layouts.
  • Media Queries
    Kevin explains media queries, showing how they adjust layouts based on conditions like screen size. He demonstrates changing Flexbox layouts with media queries and emphasizes ordering styles correctly while keeping queries simple.
  • Recommended Breakpoints
    Kevin explains how to choose breakpoints in media queries, highlighting common framework values and the importance of creating breakpoints when layouts break. He emphasizes keeping media queries simple for easier maintenance.
  • Responsive Typography
    Kevin explains responsive typography, comparing media queries with intrinsic viewport-based approaches. He demonstrates using Clamp and tools like Utopia to adjust font sizes dynamically for accessibility and better design across screen sizes.
  • Container Queries
    Kevin introduces container queries, showing how they adjust layouts based on container size rather than screen size. He demonstrates their use, explains the need for defined containers, and highlights their advantages over traditional media queries for creating dynamic, responsive designs.

Positioning

Section Duration: 1 hour, 5 minutes
  • Position Fixed
    Kevin explains CSS positioning, covering static, absolute, fixed, relative, and sticky. He demonstrates position fixed, showing how elements stay attached to the viewport and can be moved with top, bottom, left, and right, highlighting its use for UI elements like navigation bars.
  • Position Sticky
    Kevin explains position sticky, showing how elements stick within their parent container once a point is reached. He demonstrates it with a navigation bar and highlights its limitations compared to position fixed.
  • Position Relative & Absolute
    Kevin explains position relative, showing how elements can be moved without affecting surrounding layout. He then covers position absolute, demonstrating how elements position within a parent container and behave in scrolling and layout contexts.
  • Position Tags within a Card
    Kevin guides students through using position absolute in a card layout, explaining the HTML structure and semantic hierarchy. He demonstrates styling techniques, including padding, positioning, and adjusting colors and fonts for quick visual improvements.
  • z-index & Stacking Context
    Kevin explains z-index and stacking contexts, showing how elements layer based on z-index values. He demonstrates using position absolute and z-index, discusses common issues with stacking, and shows how isolation can create a new stacking context safely.

Decorations & Effects

Section Duration: 57 minutes

Animation & Interaction

Section Duration: 1 hour, 18 minutes
  • Form Input Focus
    Kevin explains the importance of visual feedback in forms and shows how CSS focus styles help users understand which fields are active. He demonstrates techniques like outlines and border changes to improve usability and accessibility during user interaction.
  • Form Input Validation
    Kevin explains how user valid and user invalid CSS states provide real-time feedback in form inputs. He demonstrates showing success and error states based on user interaction and how to target specific inputs for better validation styling.
  • :has Selector
    Kevin introduces the :has selector and shows how to style a fieldset based on its contents. He also demonstrates using accent-color to quickly and accessibly customize form controls.
  • Required Field Indicator
    Kevin introduces the :has selector and shows how to use it to style required form fields and labels for better accessibility. He also explains key limitations of :has, including why it cannot be nested or chained freely.
  • CSS Transitions
    Kevin introduces CSS transitions and animations, showing how to add effects like hover changes and rotations. He explains the transition property, duration, timing functions, and demonstrates using transforms and opacity for smooth, efficient animations.
  • Transforms & Opacity
    Kevin introduces CSS transforms, demonstrating how to use scale, rotate, translate, and skew to manipulate elements. He shows examples of combining transforms and explains why the order of application matters.
  • Animate Buttons with Transitions
    Kevin demonstrates how to animate buttons with CSS, adding hover and active effects. He shows how to adjust transition timing and duration for smooth interactions and explains using the clip property to prevent overflow.
  • CSS Animations
    Kevin introduces CSS animations, explaining keyframes and how they differ from transitions. He demonstrates creating keyframes, applying them with the animation shorthand, and adjusting duration, iteration, direction, and fill mode. Kevin also highlights performance considerations and using dev tools to optimize animations.

Wrapping Up

Section Duration: 2 minutes

Learn Straight from the Experts Who Shape the Modern Web

  • 250+
    In-depth Courses
  • Industry Leading Experts
  • 24
    Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now