W3docs

CSS - The Complete Guide (incl. Flexbox, Grid & Sass)

Learn CSS for the first time or brush up your CSS skills and dive in even deeper. EVERY web developer has to know CSS.

Start course

CSS - short for Cascading Style Sheets - is a "programming language" you use to turn your raw HTML pages into real beautiful websites.

This course covers it all - we start at the very basics (What is CSS? How does it work? How do you use it)? and gradually dive in deeper and deeper. And we do this by showing both practical examples as well as the theory behind it.

Getting started with CSS might look easy but there actually is a lot of depth to CSS - hence this course provides different "Tracks" or "Entry points" to exactly meet your demands and reflect you current knowledge level:

  • The Basics Track:Start from scratch, learn CSS from the ground up. You start with lecture 1 and simply follow through to the end.
  • The Advanced Track: You already know the CSS basics, you know what selectors are and how it works but you want to dive in deeper and learn some advanced features and usages.
  • The Expert Track: You got the advanced knowledge, too, but you want to dive into things like Flexbox, CSS Grid, CSS Variables or Sass. This track is for you.

Of course this course offers the theory and practical examples - we'll build an entire real course project throughout the course - but there also are multiple assignments, quizzes and challenges for you to practice individual concepts taught throughout the course.

Talking about the course project - we'll build the frontend (no backend) of a fictional web hosting company. We'll have a starting screen which has different sections, we got a responsive design with an animated side-drawer, we got modals and forms and in general we got a lot of CSS animations, font styles and more!

Here's what's inside the course in detail - this is all also applied to the mentioned course project:

  • The basics about selectors, combinators and how you set up styling rules in general
  • Properties, values and decalarations
  • How specifity and inheritance work and why it's called "Cascading" Style Sheets
  • Important theoretical concepts like the "Box Model"
  • How the default position of elements can be changed
  • Styling backgrounds (e.g. gradients) and images
  • Which units and dimensions you typically use in CSS (px, rem, % and more)
  • How JavaScript and CSS interact
  • Responsive design and what "Mobile First" means
  • Styling forms and form inputs
  • Working with text, fonts and text styles
  • Flexbox! How it works and how to use it
  • Using the CSS Grid and how it differs from Flexbox
  • Transforming and animating HTML elements with the help of CSS
  • Writing future-proof CSS with features like CSS variables or best-practice class names
  • Using Sass and what it actually is all about

Is this course for you?

It's for you if ...

  • you started with learning web development and you want to build more beautiful websites
  • you already know CSS but want to dive deeper
  • you're using CSS in a trial-and-error manner and want to change this (you should!)

You might come back later if ...

  • you're an absolute CSS pro and you know the CSS working group drafts by heart
  • you're a backend-only developer (Node, PHP, NO HTML or frontend JavaScript)
  • you're a total newcomer to web development and you don't know the basics about HTML

Course content

Section 1Getting Started

  • Introduction
    1:39
  • What is CSS?
    2:59
  • CSS History, Present & Future
    1:50
  • Join our Online Learning Community
    1:00
  • Course Outline
    4:34
  • Course Prerequisites
    0:43
  • How To Get The Most Out Of This Course
    2:49
  • Recommended Tools
    1:26
  • Useful Resources & Links
    1:00
  • Where to Find the Source Code
    1:00

Section 2Diving Into the Basics of CSS

  • Module Introduction
    0:55
  • Understanding the Course Project Setup
    2:44
  • Adding CSS to our Project with Inline StylesPremium
    3:53
  • Understanding the "style" Tag & Creating a .css FilePremium
    6:27
  • Applying Additional Styles & Importing Google FontsPremium
    6:51
  • Theory Time - SelectorsPremium
    8:56
  • Understanding the "Cascading" Style & SpecificityPremium
    8:14
  • Understanding InheritancePremium
    5:47
  • Adding CombinatorsPremium
    6:16
  • Theory Time - CombinatorsPremium
    5:42
  • Summarizing Properties & SelectorsPremium
    3:49
  • Assignment - The Basics (Problem)Premium
    3:15
  • Assignment - The Basics (Solution)Premium
    12:40
  • Wrap UpPremium
    2:02
  • Useful Resources & LinksPremium
    1:00

Section 3Diving Deeper into CSS

  • Module IntroductionPremium
    1:19
  • Introducing the CSS Box ModelPremium
    3:36
  • Understanding the Box ModelPremium
    3:01
  • Understanding Margin Collapsing and Removing Default MarginsPremium
    3:05
  • Deep Dive on "Margin Collapsing"Premium
    1:00
  • Theory Time - Working with Shorthand PropertiesPremium
    3:48
  • Applying Shorthands in PracticePremium
    2:05
  • Diving Into the Height & Width PropertiesPremium
    6:07
  • Understanding Box SizingPremium
    6:43
  • Adding the Header to our ProjectPremium
    5:37
  • Understanding the Display PropertyPremium
    7:12
  • display: none vs visibility: hiddenPremium
    1:00
  • HTML Refresher: Block-level vs Inline ElementsPremium
    1:00
  • Applying the Display Property & Styling our Navigation BarPremium
    6:53
  • Understanding an Unexpected "inline-block" BehaviourPremium
    2:03
  • Working with "text-decoration" & "vertical-align"Premium
    4:54
  • Styling Anchor TagsPremium
    4:00
  • Adding Pseudo ClassesPremium
    1:47
  • Theory Time - Pseudo Classes & Pseudo ElementsPremium
    5:38
  • Grouping RulesPremium
    1:14
  • Working with "font-weight" & "border"Premium
    2:04
  • Adding & Styling a CTA-ButtonPremium
    4:09
  • Adding a Background Image to our ProjectPremium
    1:50
  • Properties Worth to RememberPremium
    1:29
  • Assignment - Diving Deeper (Problem)Premium
    3:08
  • Assignment - Diving Deeper (Solution)Premium
    16:26
  • Wrap UpPremium
    2:31
  • Useful Resources & LinksPremium
    1:00

Section 4More on Selectors & CSS Features

  • Module IntroductionPremium
    0:41
  • Using Multiple CSS Classes & Combined SelectorsPremium
    7:09
  • Classes or IDs?Premium
    4:05
  • (Not) using !importantPremium
    3:15
  • Selecting the Opposite with :not()Premium
    3:29
  • CSS & Browser SupportPremium
    3:51
  • Wrap UpPremium
    1:06
  • Useful Resources & LinksPremium
    1:00

Section 5Practicing the Basics

  • Module IntroductionPremium
    0:37
  • Adding Style to our PlansPremium
    8:34
  • Working on the Recommended PlanPremium
    6:33
  • Styling the Badge with "border-radius"Premium
    3:22
  • Styling our ListPremium
    3:02
  • Working on the Title and the Price of our PackagesPremium
    4:33
  • Improving our Action ButtonPremium
    6:40
  • Understanding OutlinesPremium
    2:17
  • Presenting the Core Features to the UserPremium
    1:22
  • Styling the Headline of the Core Features SectionPremium
    3:38
  • Preparing the Content of the Key Feature AreaPremium
    7:15
  • Adding the FooterPremium
    6:49
  • What we Achieved so FarPremium
    1:46
  • Adding the Packages PagePremium
    6:24
  • Your ChallengePremium
    1:31
  • Styling the LinksPremium
    3:55
  • Styling our Package BoxesPremium
    7:15
  • Adding "float" to our PackagePremium
    5:14
  • Fixing the Hover EffectPremium
    4:11
  • Adding the Final TouchesPremium
    3:01
  • Useful Resources & LinksPremium
    1:00

Section 6Positioning Elements with CSS

  • Module IntroductionPremium
    2:44
  • Why Positioning will Improve our WebsitePremium
    2:32
  • Understanding Positioning - The TheoryPremium
    5:54
  • Working with the "fixed" ValuePremium
    9:50
  • Creating a Fixed Navigation BarPremium
    3:54
  • Using "position" to Add a Background ImagePremium
    6:03
  • Understanding the Z-IndexPremium
    6:59
  • Adding a Badge to our PackagePremium
    8:00
  • Styling & Positioning our Badge with "absolute" and "relative"Premium
    3:10
  • Diving Deeper into Relative PositioningPremium
    4:02
  • Working with "overflow" and Relative PositioningPremium
    4:17
  • Introducing "sticky" PositioningPremium
    6:53
  • Understanding the Stacking ContextPremium
    5:53
  • Assignment - Positioning (Problem)Premium
    4:41
  • Assignment - Positioning (Solution)Premium
    14:35
  • Wrap UpPremium
    4:12
  • Useful Resources & LinksPremium
    1:00

Section 7Understanding Background Images & Images

  • Optional: Advanced Track IntroductionPremium
    2:22
  • Module IntroductionPremium
    1:05
  • Understanding "background-size"Premium
    8:41
  • Working with "background-position"Premium
    5:00
  • The "background" Shorthand - TheoryPremium
    2:12
  • Applying "background" Origin, Clip & AttachmentPremium
    5:51
  • Using the "background" Shorthand on our ProjectPremium
    2:19
  • Styling ImagesPremium
    7:33
  • Adding the Customers Page to our WebsitePremium
    3:19
  • Working on the Image LayoutPremium
    8:07
  • Understanding Linear GradientsPremium
    6:16
  • Applying Radial GradientsPremium
    5:41
  • Stacking Multiple BackgroundsPremium
    4:50
  • Understanding FiltersPremium
    4:00
  • Adding & Styling SVGs - The BasicsPremium
    4:20
  • Wrap UpPremium
    2:14
  • Useful Resources & LinksPremium
    1:00

Section 8Sizes & Units

  • Module IntroductionPremium
    2:35
  • What's Wrong With Our Project Units?Premium
    5:21
  • Where Units MatterPremium
    6:02
  • An Overview of Available Sizes & UnitsPremium
    4:24
  • Rules to Remember: Fixed Positioning & "%"Premium
    4:15
  • Rules to Remember: Absolute Positioning & "%"Premium
    8:14
  • Rules to Remember: Relative / Static Positioning & "%"Premium
    8:53
  • Fixing the Height 100% IssuePremium
    12:02
  • Defining the Font Size in the Root ElementPremium
    2:18
  • Using "min-width/height" & "max-width/height"Premium
    5:27
  • Working with "rem" & "em"Premium
    12:47
  • Adding "rem" to Additional PropertiesPremium
    8:17
  • Finishing "rem"Premium
    5:21
  • Understanding the Viewport Units "vw" &"vh"Premium
    9:47
  • Windows, Viewport Units & ScrollbarsPremium
    1:00
  • Choosing the Right UnitPremium
    5:30
  • Using "auto" to Center ElementsPremium
    1:42
  • Cleaning Up our CodePremium
    1:06
  • Wrap UpPremium
    4:23
  • Useful Resources & LinksPremium
    1:00

Section 9Working with JavaScript & CSS

  • Module IntroductionPremium
    1:16
  • Adding a ModalPremium
    4:13
  • Selecting & Manipulating Styles with JavaScriptPremium
    10:34
  • Adding an Event ListenerPremium
    6:05
  • Assignment - Adding Style with JavaScript (Problem)Premium
    0:45
  • Assignment - Adding Style with JavaScript (Solution)Premium
    3:58
  • Adding a Side Navigation BarPremium
    7:14
  • Opening and Closing the Hamburger MenuPremium
    3:57
  • Manipulating Element ClassesPremium
    6:40
  • Understanding Property NotationsPremium
    3:12
  • Cleaning Up our CodePremium
    5:31
  • Wrap UpPremium
    1:15
  • Useful Resources & LinksPremium
    1:00

Section 10Responsive Design

  • Module IntroductionPremium
    1:45
  • Why our Project Should Become ResponsivePremium
    2:25
  • Understanding Hardware Pixels vs. Software PixelsPremium
    10:29
  • Comparing the Viewport Metatag (HTML) and Media Queries (CSS)Premium
    3:04
  • Understanding the "viewport" MetatagPremium
    7:22
  • Designing Websites "Mobile First"Premium
    1:54
  • Adding our First Media QueriesPremium
    12:52
  • Things to Keep in Mind when Working with Media QueriesPremium
    8:09
  • Finding the Right Breaking PointsPremium
    3:45
  • Creating the Mobile First Design for our PlansPremium
    6:37
  • Making the Plans ResponsivePremium
    8:35
  • Your ChallengePremium
    6:06
  • Assignment - Responsive Websites (Problem)Premium
    3:00
  • Assignment - Responsive Websites (Solution)Premium
    8:07
  • Working with Logical OperatorsPremium
    8:13
  • Improving the Customers PagePremium
    14:58
  • Improving the Packages PagePremium
    5:41
  • Cleaning Up the Navigation BarPremium
    4:39
  • Positioning our Footer CorrectlyPremium
    10:09
  • Wrap UpPremium
    2:15
  • Useful Resources & LinksPremium
    1:00

Section 11Adding & Styling Forms

  • Module IntroductionPremium
    1:32
  • Adding the Unstyled FormPremium
    2:37
  • Page InitializationPremium
    6:35
  • Understanding Advanced Attribute SelectorsPremium
    6:02
  • Working on the General LayoutPremium
    7:15
  • Restyling the Form ElementsPremium
    6:29
  • Styling the CheckboxPremium
    6:52
  • Providing Validation FeedbackPremium
    8:50
  • Styling the Signup ButtonPremium
    3:42
  • Fixing a Broken LinkPremium
    1:00
  • Wrap UpPremium
    1:29
  • Useful Resources & LinksPremium
    1:00

Section 12Working with Text and Fonts

  • Module IntroductionPremium
    1:20
  • Comparing Generic Families & Font FamiliesPremium
    2:56
  • Understanding the Browser SettingsPremium
    6:17
  • Using the Default Font FamiliesPremium
    6:53
  • Understanding the "font-family" SyntaxPremium
    6:18
  • Working with Locally Saved FontsPremium
    3:50
  • Working with Google FontsPremium
    10:28
  • Understanding Font Faces & "font-style"Premium
    6:49
  • Importing our Custom FontsPremium
    9:03
  • Understanding Font FormatsPremium
    5:41
  • Diving into Font PropertiesPremium
    3:10
  • Adding "letter-spacing"Premium
    4:43
  • Changing the Line HeightPremium
    6:07
  • Applying "text-decoration" & "text-shadow"Premium
    5:51
  • Understanding the "font" ShorthandPremium
    8:39
  • Loading Performance & "font-display"Premium
    9:49
  • Wrap UpPremium
    3:47
  • Useful Resources & LinksPremium
    1:00

Section 13Adding Flexbox to our Project

  • Optional: Expert Track IntroductionPremium
    3:23
  • Module IntroductionPremium
    1:31
  • How we Could Improve our ProjectPremium
    2:58
  • Understanding FlexboxPremium
    3:18
  • Creating a Flex ContainerPremium
    5:33
  • Using "flex-direction" & "flex-wrap"Premium
    8:55
  • Understanding the Importance of Main Axis & Cross AxisPremium
    7:27
  • Working with "align-items" & "justify-content"Premium
    10:59
  • And What About "align-content"?Premium
    2:40
  • Improving the Navigation Bar with FlexboxPremium
    12:02
  • Your Challenge - Working on the Mobile Navigation BarPremium
    4:16
  • Improving the FooterPremium
    8:55
  • Assignment - Flexbox (Problem)Premium
    4:19
  • Assignment - Flexbox (Solution)Premium
    8:32
  • Flexbox and the Z-IndexPremium
    1:00
  • Adding Flexbox to the Customers PagePremium
    3:16
  • Using the "order" Property for a Flex ItemPremium
    6:07
  • Working with "align-self"Premium
    2:44
  • Understanding "flex-grow"Premium
    7:35
  • Applying "flex-shrink"Premium
    3:12
  • Comparing "flex-basis" vs "width" & "height"Premium
    8:35
  • Wrap UpPremium
    3:52
  • Useful Resources & LinksPremium
    1:00

Section 14Using the CSS Grid

  • Module IntroductionPremium
    1:14
  • What is the CSS Grid?Premium
    1:27
  • Getting StartedPremium
    2:22
  • Turning a Container into a GridPremium
    3:21
  • Defining Columns & RowsPremium
    5:49
  • Positioning Child Elements in a GridPremium
    4:13
  • Using "element-sizing", "repeat" & "minmax"Premium
    6:45
  • Advanced Element PositioningPremium
    6:30
  • Working with Named LinesPremium
    3:53
  • Assignment - Grid (Problem)Premium
    0:49
  • Assignment - Grid (Solution)Premium
    9:14
  • Understanding Column & Row ShorthandsPremium
    2:54
  • Working with GapsPremium
    2:33
  • Adding Named Template AreasPremium
    6:39
  • Assignment - Diving Deeper (Problem)Premium
    0:38
  • Assignment - Diving Deeper (Solution)Premium
    3:22
  • Creating Automatically Generated Grid AreasPremium
    7:10
  • Using the Grid on our ProjectPremium
    9:10
  • Working with "fit-content"Premium
    3:31
  • Positioning Grid ElementsPremium
    3:35
  • Positioning the Entire Grid ContentPremium
    3:17
  • Positioning Elements IndividuallyPremium
    1:34
  • Understanding Responsive GridsPremium
    5:30
  • Applying AutoflowPremium
    6:39
  • Comparing the Explicit & Implicit GridPremium
    2:31
  • Understanding "auto-fill" & "auto-fit"Premium
    3:33
  • Creating a Dense GridPremium
    3:22
  • Styling the Project Form with GridPremium
    9:45
  • Comparing Grid & FlexboxPremium
    2:27
  • Next StepsPremium
    1:31
  • Wrap UpPremium
    3:49
  • Useful Resources & LinksPremium
    1:00

Section 15Transforming Elements with CSS Transforms

  • Module IntroductionPremium
    0:31
  • Rotating Elements and setting transform-originPremium
    3:45
  • Using Rotate and TranslatePremium
    4:57
  • Working with "skew" and "scale"Premium
    6:18
  • Applying Transformation ShorthandsPremium
    2:23
  • Rotating Elements in 3 DimensionsPremium
    4:19
  • Understanding the "perspective" PropertyPremium
    3:37
  • Moving Elements along the Z-Axis with "translateZ"Premium
    3:54
  • Rotating the Container with "transform style"Premium
    3:44
  • Flipping Elements & "backface-visibility"Premium
    1:15
  • Wrap UpPremium
    1:14
  • Useful Resources & LinksPremium
    1:00

Section 16Transitions & Animations in CSS

  • Module IntroductionPremium
    0:22
  • Understanding and Applying TransitionsPremium
    7:23
  • CSS "transition" Property Deep DivePremium
    1:00
  • Working with Timing FunctionsPremium
    2:50
  • Transitions & "display"Premium
    6:11
  • Assignment - CSS Transitions (Problem)Premium
    0:48
  • Assignment - CSS Transitions (Solution)Premium
    2:12
  • Using CSS AnimationsPremium
    9:00
  • CSS "animation" Property Deep DivePremium
    1:00
  • Adding Multiple KeyframesPremium
    3:22
  • Adding Animations to our Customers PagePremium
    3:59
  • Assignment - Animations (Problem)Premium
    0:33
  • Assignment - Animations (Solution)Premium
    3:03
  • Using JavaScript Animation Event ListenersPremium
    3:24
  • Wrap UpPremium
    1:35
  • Useful Resources & LinksPremium
    1:00

Section 17Writing Future-Proof CSS Code

  • Module IntroductionPremium
    0:34
  • CSS Modules & Their Working GroupsPremium
    1:55
  • Using CSS VariablesPremium
    7:31
  • Understanding & Using Vendor PrefixesPremium
    4:47
  • Which Prefixes Should You Use?Premium
    2:58
  • Detecting Browser Support with @supportsPremium
    5:09
  • PolyfillsPremium
    2:45
  • Eliminating Cross-Browser InconsistenciesPremium
    2:58
  • How to Name CSS ClassesPremium
    4:52
  • Vanilla CSS vs FrameworksPremium
    8:36
  • Wrap UpPremium
    4:16
  • Useful Resources & LinksPremium
    1:00

Section 18Introducing Sass (Syntactically Awesome Style Sheets)

  • Module IntroductionPremium
    0:42
  • What is Sass & Scss?Premium
    3:30
  • Installing SassPremium
    4:25
  • Things to be Improved with SassPremium
    1:33
  • Nesting SelectorsPremium
    6:35
  • Adding Nested PropertiesPremium
    1:27
  • Understanding VariablesPremium
    3:05
  • Storing Lists & Maps in VariablesPremium
    5:58
  • Built-In FunctionsPremium
    3:18
  • Assignment - Sass (Problem)Premium
    0:49
  • Assignment - Sass (Solution)Premium
    3:42
  • Adding Simple ArithmeticsPremium
    2:24
  • Adding Better Import and PartialsPremium
    4:46
  • Improving Media QueriesPremium
    2:24
  • Understanding InheritancePremium
    3:33
  • Adding MixinsPremium
    6:45
  • Using the Ampersand OperatorPremium
    2:57
  • Wrap UpPremium
    1:13
  • Useful Resources & LinksPremium
    1:00

Section 19Course Roundup

  • Course RoundupPremium
    1:56

Course instructor

Photo of Maximilian Schwarzmüller

Maximilian Schwarzmüller

As a self-taught professional I really know the hard parts and the difficult topics when learning new or improving on already-known languages. This background and experience enable me to focus on the most relevant key concepts and topics. My track record of many 5-star rated courses, more than 1,000,000 students worldwide as well as a successful YouTube channel is the best proof for that.

The most rewarding experience for me is to see how people find new, better jobs, build awesome web applications, work on amazing projects or simply enjoy their hobby with the help of my content. That's why, together with Manuel Lorenz, I founded Academind to offer the best possible learning experience and to share the pleasure of learning with our students.