Master CSS: Build Real Apps, Skip the Noise

A practical 203-minute CSS course that teaches only the essential properties by building two complete applications. Covers selectors, typography, the box model, flexbox, grid, positioning, and responsive design—skipping memorization and focusing on what actually matters for building.

Why This Approach Works

Skip the noise, focus on essentials

Most CSS beginners waste time memorizing every property and edge case. This course teaches only the core properties you use daily, allowing you to learn the rest on-the-job through documentation.

Learn by building real applications

Rather than isolated exercises, you build two complete, deployable web applications (an educational landing page and a news site). This forces you to understand how CSS properties work together in practice.

Foundation: Selectors and the HTML-CSS Connection

Four core selector types

Universal selector (*) targets everything; element selectors (div, body) target tag types; class selectors (.hero) target specific elements you want to reuse; ID selectors (#id) target unique elements. Classes are used ~90% of the time because they're reusable and less specific than IDs.

Parent-child relationships determine inheritance

CSS properties set on a parent element (like font-family on body) are inherited by all child elements unless overridden. Understanding this hierarchy prevents redundant styling and makes layouts predictable.

Typography and Colors

Font sizing: pixels vs. rem vs. em

Pixels (px) are absolute and don't scale; rem is relative to the root font size (usually 16px) and scales consistently across browsers; em is relative to the parent element's font size. Use rem for fonts to ensure consistency across different screen sizes.

Color formats: hex, RGB, RGBA, HSL

Hex (#FFF or #FFFFFF) is most common for solid colors. RGB (0-255 per channel) and RGBA add opacity (0-1). HSL (hue 0-360°, saturation 0-100%, lightness 0-100%) is intuitive for designers. Use RGBA when you need transparency.

Font properties: weight, family, text styling

Font-weight ranges from 100 (thin) to 900 (black); 500 is medium, 700 is bold. Font-family should include fallbacks (e.g., 'Poppins', times, serif). Text-transform, letter-spacing, line-height, and word-spacing fine-tune appearance but are rarely needed—use them only when required.

The Box Model: Padding, Margin, Border

Every element is a box with four layers

From inside out: content (width/height), padding (space inside the border), border (line around padding), margin (space outside the border). Padding is part of the element; margin is outside it. This distinction matters for spacing and layout.

Box-sizing: content-box vs. border-box

Content-box (default) means width/height apply only to content; padding and border are added on top. Border-box includes padding and border in the width/height. Set box-sizing: border-box on the universal selector (*) early to avoid confusion.

Padding and margin shorthand

padding: 10px 20px sets 10px top/bottom, 20px left/right. padding: 30px 5px 0px 20px sets top, right, bottom, left (clockwise). Margin works identically. Margin: 0 auto centers elements horizontally.

Border and box-shadow for visual depth

Border shorthand: border: 1px solid #color. Dashed and dotted are alternatives to solid. Box-shadow adds depth: box-shadow: 0 2px 8px rgba(0,0,0,0.2) creates a subtle shadow. Use box-shadow tools to avoid manual calculation.

Flexbox: One-Dimensional Layouts

When to use flexbox: one-dimensional layouts

Use flexbox when items flow in a single direction (left-to-right or top-to-bottom). The flex container holds flex items. Main axis is the primary direction; cross axis is perpendicular. Flexbox is ideal for navbars, button groups, and single-row/column layouts.

Key flexbox properties on the container

display: flex enables flexbox. justify-content (space-between, center, flex-start, flex-end, space-around, space-evenly) aligns items along the main axis. align-items (center, flex-start, flex-end) aligns along the cross axis. gap adds space between items. flex-direction (row, column) sets the main axis.

Flexbox item properties: flex-grow, flex-shrink, flex-basis

flex: 1 is shorthand for flex-grow: 1, flex-shrink: 1, flex-basis: 0. This makes items grow equally to fill space. flex-basis: 50% sets the initial width. Use flex: 1 on multiple items to split space evenly (e.g., two items with flex: 1 each take 50% width).

Grid: Two-Dimensional Layouts

When to use grid: two-dimensional layouts

Use grid when items need to align in both rows and columns (2D). Grid is more powerful than flexbox for complex layouts. Define grid-template-columns and grid-template-rows to set the structure. Use grid-template-areas for visual, maintainable layouts.

Grid template columns with repeat and auto-fit

grid-template-columns: repeat(3, 1fr) creates 3 equal columns. repeat(auto-fit, minmax(200px, 1fr)) creates responsive columns: each at least 200px wide, growing to fill space. This is the key to responsive grid layouts without media queries.

Grid template areas for complex layouts

Define grid-template-areas as a visual map of named regions. Each grid item gets a grid-area name. This makes complex layouts readable and maintainable. Example: grid-template-areas: 'header header' 'sidebar main' visually shows the layout in CSS.

Grid item placement: grid-column, grid-row, span

grid-column: 1 / 3 places an item from column 1 to 3 (spans 2 columns). grid-column: span 2 is shorthand. grid-row works identically for rows. This allows items to occupy multiple cells, creating asymmetric layouts.

Positioning: Absolute and Relative

Position relative: anchor for absolute children

position: relative on a parent element makes it the positioning context for absolutely positioned children. It doesn't move the element itself. Use this to overlay text or icons on images without disrupting the layout.

Position absolute: overlay elements on parents

position: absolute on a child element positions it relative to the nearest positioned ancestor (position: relative parent). Use top, bottom, left, right to place it. Absolute positioning removes the element from document flow, so it doesn't affect other elements.

When NOT to use absolute/relative for layout

Avoid absolute/relative for main layout (navbars, content sections). They break responsive design and are hard to maintain. Use flexbox or grid instead. Reserve absolute/relative for overlays, badges, and decorative elements only.

Pseudo-elements (::before, ::after) for overlays

Use ::before or ::after pseudo-elements with position: absolute to add overlays without extra HTML. Set content: '' to create an invisible overlay, then style with background, opacity, etc. This is cleaner than adding HTML elements.

Responsive Design with Media Queries

Media queries: adapt layout to screen size

@media screen and (max-width: 768px) { ... } applies CSS only when the screen is 768px or smaller. Use max-width for mobile-first design (start with mobile, add complexity for larger screens). Change layout properties like flex-direction or display to adapt.

Grid and flexbox make responsive design easier

If you build with grid (repeat auto-fit, minmax) or flexbox correctly, responsive design often requires minimal media queries. Change flex-direction: column or switch display: grid to display: block only when needed. Proper foundational layout reduces responsive headaches.

Common breakpoints and responsive patterns

Mobile-first: start with mobile layout, use min-width breakpoints for larger screens. Common breakpoints: 480px (mobile), 768px (tablet), 1024px (desktop). For featured sections, change flex-direction to column on mobile. For grids, switch to single-column on mobile.

Practical Workflow and Tools

Essential tools: VS Code, Live Server, Prettier

Use VS Code as your editor. Install Live Server extension to preview changes instantly (localhost:5500). Install Prettier to auto-format code on save for consistency. These tools speed up development and reduce errors.

Pesticide browser extension for debugging

Pesticide (Chrome/Brave) visualizes every element's box model with colored outlines. Use it to understand padding, margin, and element relationships. This makes debugging layout issues much faster.

Box-shadow and color picker tools

Use online tools or VS Code's built-in color picker to generate box-shadow and colors visually. Don't memorize box-shadow syntax; use a tool to generate it, then copy-paste. This saves time and reduces errors.

Deployment: Hostinger for hosting

Use Hostinger (or similar) to deploy applications. Upload files via file manager to public_html. Get a free domain for one year. This lets you showcase work to others and practice real-world deployment.

Common CSS Mistakes to Avoid

Don't use float for layout

Float is deprecated for layout. It was the old way before flexbox and grid. Always use flexbox or grid instead. Float causes alignment issues and is hard to maintain.

Don't overuse absolute positioning

Absolute positioning breaks responsive design and makes code hard to maintain. Use it only for overlays and decorative elements. Use flexbox/grid for main layout.

Don't memorize every CSS property

There are hundreds of CSS properties. You only need ~20 core ones. Learn the rest on-the-job via MDN documentation. Spending time memorizing is wasted effort; focus on building.

Don't use too many colors

Limit your palette to 2-3 main colors. Too many colors look amateurish. Use a color picker tool to find complementary colors. Consistency in color makes designs look professional.

Notable quotes

Skip all that noise and focus on the most essential aspects of CSS. — Ed Roh
Flexbox is your go-to first option for one-dimensional layouts. — Ed Roh
Grid makes responsive design a lot easier than trying to do something with flexbox. — Ed Roh

Action items

  • Download the starter kit (app 1, app 2, app 3) from the course link and open in VS Code.
  • Install Live Server and Prettier extensions in VS Code for instant preview and auto-formatting.
  • Build App 1 (educational landing page) following the step-by-step guide, focusing on selectors, typography, box model, and flexbox.
  • Build App 2 (news site) to practice grid layouts, complex positioning, and responsive design with media queries.
  • Deploy both applications to Hostinger (or similar) using the file manager to practice real-world deployment.
  • Use Pesticide extension while building to visualize box models and debug layout issues.
  • Practice responsive design by resizing your browser and adjusting layouts with media queries.
  • Refer to MDN documentation for any CSS properties not covered in the course.
  • Avoid using absolute/relative positioning for main layout; reserve it for overlays only.
  • Set box-sizing: border-box on the universal selector (*) at the start of every project.
EdRoh
3 hr 23 min video
3 min read
Master CSS: Build Real Apps, Skip the Noise
You just saved 3 hr 20 min.
The big takeaway
A practical 203-minute CSS course that teaches only the essential properties by building two complete applications. Covers selectors, typography, the box model, flexbox, grid, positioning, and responsive design—skipping memorization and focusing on what actually matters for building.
Why This Approach Works
Skip the noise, focus on essentials
Most CSS beginners waste time memorizing every property and edge case. This course teaches only the core properties you use daily, allowing you to learn the rest on-the-job through documentation.
Learn by building real applications
Rather than isolated exercises, you build two complete, deployable web applications (an educational landing page and a news site). This forces you to understand how CSS properties work together in practice.
Foundation: Selectors and the HTML-CSS Connection
Four core selector types
Universal selector (*) targets everything; element selectors (div, body) target tag types; class selectors (.hero) target specific elements you want to reuse; ID selectors (#id) target unique elements. Classes are used ~90% of the time because they're reusable and less specific than IDs.
1
Class selector (.classname)
~90% of use
2
Element selector (div, p, h1)
Common for base styling
3
Universal selector (*)
Reset defaults once
4
ID selector (#id)
Avoid—too specific, not reusable
Selector usage hierarchy in real projects
Parent-child relationships determine inheritance
CSS properties set on a parent element (like font-family on body) are inherited by all child elements unless overridden. Understanding this hierarchy prevents redundant styling and makes layouts predictable.
Typography and Colors
Font sizing: pixels vs. rem vs. em
Pixels (px) are absolute and don't scale; rem is relative to the root font size (usually 16px) and scales consistently across browsers; em is relative to the parent element's font size. Use rem for fonts to ensure consistency across different screen sizes.
Pixels (px)
32 absolute, no scaling
rem (root em)
2.2 relative to root (16px)
em
2 relative to parent
Font size units: rem is preferred for responsive design
Color formats: hex, RGB, RGBA, HSL
Hex (#FFF or #FFFFFF) is most common for solid colors. RGB (0-255 per channel) and RGBA add opacity (0-1). HSL (hue 0-360°, saturation 0-100%, lightness 0-100%) is intuitive for designers. Use RGBA when you need transparency.
1
Hex (#5BB471)
Most common
2
RGBA (52, 199, 89, 0.2)
When transparency needed
3
RGB (52, 199, 89)
Solid colors
4
HSL (200, 50%, 50%)
Designer-friendly
Color format use cases
Font properties: weight, family, text styling
Font-weight ranges from 100 (thin) to 900 (black); 500 is medium, 700 is bold. Font-family should include fallbacks (e.g., 'Poppins', times, serif). Text-transform, letter-spacing, line-height, and word-spacing fine-tune appearance but are rarely needed—use them only when required.
font-weight: 300
300 light
font-weight: 500
500 medium
font-weight: 700
700 bold
font-weight: 900
900 black
Common font-weight values
The Box Model: Padding, Margin, Border
Every element is a box with four layers
From inside out: content (width/height), padding (space inside the border), border (line around padding), margin (space outside the border). Padding is part of the element; margin is outside it. This distinction matters for spacing and layout.
Box-sizing: content-box vs. border-box
Content-box (default) means width/height apply only to content; padding and border are added on top. Border-box includes padding and border in the width/height. Set box-sizing: border-box on the universal selector (*) early to avoid confusion.
content-box (default)
width: 300px + padding + border = total > 300px
border-box
width: 300px includes padding & border
Box-sizing impact on element dimensions
Padding and margin shorthand
padding: 10px 20px sets 10px top/bottom, 20px left/right. padding: 30px 5px 0px 20px sets top, right, bottom, left (clockwise). Margin works identically. Margin: 0 auto centers elements horizontally.
1
padding: 10px → all sides
2
padding: 10px 20px → top/bottom, left/right
3
padding: 10px 20px 30px 40px → top, right, bottom, left (clockwise)
4
margin: 0 auto → centers horizontally
Box model shorthand syntax
Border and box-shadow for visual depth
Border shorthand: border: 1px solid #color. Dashed and dotted are alternatives to solid. Box-shadow adds depth: box-shadow: 0 2px 8px rgba(0,0,0,0.2) creates a subtle shadow. Use box-shadow tools to avoid manual calculation.
Flexbox: One-Dimensional Layouts
When to use flexbox: one-dimensional layouts
Use flexbox when items flow in a single direction (left-to-right or top-to-bottom). The flex container holds flex items. Main axis is the primary direction; cross axis is perpendicular. Flexbox is ideal for navbars, button groups, and single-row/column layouts.
Key flexbox properties on the container
display: flex enables flexbox. justify-content (space-between, center, flex-start, flex-end, space-around, space-evenly) aligns items along the main axis. align-items (center, flex-start, flex-end) aligns along the cross axis. gap adds space between items. flex-direction (row, column) sets the main axis.
1
justify-content: space-between
Most common
2
align-items: center
Vertical centering
3
gap: 20px
Spacing between items
4
flex-direction: column
Vertical stacking
Essential flexbox container properties
Flexbox item properties: flex-grow, flex-shrink, flex-basis
flex: 1 is shorthand for flex-grow: 1, flex-shrink: 1, flex-basis: 0. This makes items grow equally to fill space. flex-basis: 50% sets the initial width. Use flex: 1 on multiple items to split space evenly (e.g., two items with flex: 1 each take 50% width).
Grid: Two-Dimensional Layouts
When to use grid: two-dimensional layouts
Use grid when items need to align in both rows and columns (2D). Grid is more powerful than flexbox for complex layouts. Define grid-template-columns and grid-template-rows to set the structure. Use grid-template-areas for visual, maintainable layouts.
Grid template columns with repeat and auto-fit
grid-template-columns: repeat(3, 1fr) creates 3 equal columns. repeat(auto-fit, minmax(200px, 1fr)) creates responsive columns: each at least 200px wide, growing to fill space. This is the key to responsive grid layouts without media queries.
1
repeat(3, 1fr) → 3 equal columns
2
repeat(auto-fit, minmax(200px, 1fr)) → responsive columns
3
Each column: min 200px, max 1fr (grows to fill)
4
Items wrap to next row when needed
Grid column definition patterns
Grid template areas for complex layouts
Define grid-template-areas as a visual map of named regions. Each grid item gets a grid-area name. This makes complex layouts readable and maintainable. Example: grid-template-areas: 'header header' 'sidebar main' visually shows the layout in CSS.
Grid item placement: grid-column, grid-row, span
grid-column: 1 / 3 places an item from column 1 to 3 (spans 2 columns). grid-column: span 2 is shorthand. grid-row works identically for rows. This allows items to occupy multiple cells, creating asymmetric layouts.
Positioning: Absolute and Relative
Position relative: anchor for absolute children
position: relative on a parent element makes it the positioning context for absolutely positioned children. It doesn't move the element itself. Use this to overlay text or icons on images without disrupting the layout.
Position absolute: overlay elements on parents
position: absolute on a child element positions it relative to the nearest positioned ancestor (position: relative parent). Use top, bottom, left, right to place it. Absolute positioning removes the element from document flow, so it doesn't affect other elements.
When NOT to use absolute/relative for layout
Avoid absolute/relative for main layout (navbars, content sections). They break responsive design and are hard to maintain. Use flexbox or grid instead. Reserve absolute/relative for overlays, badges, and decorative elements only.
Pseudo-elements (::before, ::after) for overlays
Use ::before or ::after pseudo-elements with position: absolute to add overlays without extra HTML. Set content: '' to create an invisible overlay, then style with background, opacity, etc. This is cleaner than adding HTML elements.
Responsive Design with Media Queries
Media queries: adapt layout to screen size
@media screen and (max-width: 768px) { ... } applies CSS only when the screen is 768px or smaller. Use max-width for mobile-first design (start with mobile, add complexity for larger screens). Change layout properties like flex-direction or display to adapt.
Grid and flexbox make responsive design easier
If you build with grid (repeat auto-fit, minmax) or flexbox correctly, responsive design often requires minimal media queries. Change flex-direction: column or switch display: grid to display: block only when needed. Proper foundational layout reduces responsive headaches.
Common breakpoints and responsive patterns
Mobile-first: start with mobile layout, use min-width breakpoints for larger screens. Common breakpoints: 480px (mobile), 768px (tablet), 1024px (desktop). For featured sections, change flex-direction to column on mobile. For grids, switch to single-column on mobile.
Mobile
480 px
Tablet
768 px
Desktop
1024 px
Common responsive breakpoints
Practical Workflow and Tools
Essential tools: VS Code, Live Server, Prettier
Use VS Code as your editor. Install Live Server extension to preview changes instantly (localhost:5500). Install Prettier to auto-format code on save for consistency. These tools speed up development and reduce errors.
Pesticide browser extension for debugging
Pesticide (Chrome/Brave) visualizes every element's box model with colored outlines. Use it to understand padding, margin, and element relationships. This makes debugging layout issues much faster.
Box-shadow and color picker tools
Use online tools or VS Code's built-in color picker to generate box-shadow and colors visually. Don't memorize box-shadow syntax; use a tool to generate it, then copy-paste. This saves time and reduces errors.
Deployment: Hostinger for hosting
Use Hostinger (or similar) to deploy applications. Upload files via file manager to public_html. Get a free domain for one year. This lets you showcase work to others and practice real-world deployment.
Common CSS Mistakes to Avoid
Don't use float for layout
Float is deprecated for layout. It was the old way before flexbox and grid. Always use flexbox or grid instead. Float causes alignment issues and is hard to maintain.
Don't overuse absolute positioning
Absolute positioning breaks responsive design and makes code hard to maintain. Use it only for overlays and decorative elements. Use flexbox/grid for main layout.
Don't memorize every CSS property
There are hundreds of CSS properties. You only need ~20 core ones. Learn the rest on-the-job via MDN documentation. Spending time memorizing is wasted effort; focus on building.
Don't use too many colors
Limit your palette to 2-3 main colors. Too many colors look amateurish. Use a color picker tool to find complementary colors. Consistency in color makes designs look professional.
Worth quoting
"Skip all that noise and focus on the most essential aspects of CSS."
— Ed Roh, at [0:30]
"Flexbox is your go-to first option for one-dimensional layouts."
— Ed Roh, at [73:33]
"Grid makes responsive design a lot easier than trying to do something with flexbox."
— Ed Roh, at [147:11]
Try this
Download the starter kit (app 1, app 2, app 3) from the course link and open in VS Code.
Install Live Server and Prettier extensions in VS Code for instant preview and auto-formatting.
Build App 1 (educational landing page) following the step-by-step guide, focusing on selectors, typography, box model, and flexbox.
Build App 2 (news site) to practice grid layouts, complex positioning, and responsive design with media queries.
Deploy both applications to Hostinger (or similar) using the file manager to practice real-world deployment.
Use Pesticide extension while building to visualize box models and debug layout issues.
Practice responsive design by resizing your browser and adjusting layouts with media queries.
Refer to MDN documentation for any CSS properties not covered in the course.
Avoid using absolute/relative positioning for main layout; reserve it for overlays only.
Set box-sizing: border-box on the universal selector (*) at the start of every project.
Made with Glimpse by Wozart
glimpse.wozart.com/v/lfl44nke
Share this infographic

More like this