Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Understanding UI & CSS: Box Model, Flexbox, Grid & Animation
New
8 students

Understanding UI & CSS: Box Model, Flexbox, Grid & Animation

Not a property reference — a mental model. Selectors, position, responsive design, rebuilding real UIs from scratch.
Created byKian Attar
Last updated 8/2026
English
English

What you'll learn

  • Look at any interface on the internet, break it into boxes, and build it from an empty file.
  • Build any layout with Grid and Flexbox — and know which one a situation is actually asking for.
  • Target any element on any page with selectors you compose yourself, and know which rule wins when two conflict.
  • Make a layout work at every screen size, with media queries, container queries, and mobile-first thinking.
  • Style a single box completely — box model, units, typography, color, backgrounds, borders, corners, and shadows.
  • Animate with transitions and keyframes, and know which properties are cheap and which make the page stutter.
  • Pick the right image format and serve the right file to every device, with no layout shift.
  • Read MDN and the CSS spec well enough to pick up any property this course didn't cover.

Course content

8 sections42 lectures10h 3m total length
  • Why HTML Isn't Enough: What Google Looks Like With No CSS7:55
  • Everything Is a Box: How CSS Sees Your Page2:58

Requirements

  • Basic HTML — you should know what a tag is and how a page is structured. If you've taken my HTML course, you're ready.
  • A computer and a browser. That's the whole toolkit — every tool used is free: VS Code, Chrome DevTools, Live Server, Squoosh.
  • No CSS experience needed. We start from the problem CSS exists to solve, not from syntax.
  • No design skill needed. The designs already exist — our job is implementing them.
  • No JavaScript required. Everything here is HTML and CSS.

Description

You’ll build a complete understanding of the box model, selectors, layout, images, and animation — and how they fit together into one system. No memorization. No property lists you’ll forget by next week. Just a foundation that finally makes sense.

Finally understand CSS — and the interfaces you build with it.

  • Style a single box completely — spacing, borders, backgrounds, gradients, and type

  • Target any element on a page with selectors you compose yourself instead of copy

  • Build any layout with Grid and Flexbox — and know which one the situation is asking for

  • Make it work at every screen size, with media queries and mobile-first thinking

  • Understand what an image actually is — pixels, formats, compression — and serve the right one

  • Animate with transitions and keyframes, and know which animations are cheap and which stall the browser

  • Open a real website and rebuild it live, from an empty file

CSS isn’t a pile of properties. It’s a system — and once you can see the system, you stop guessing.


CSS is on every page you have ever looked at. Google, your bank, every app you use, every screen you touch. But most CSS courses teach it as a property catalog — here’s display, here’s position, here’s flex, move on. That works right up until you hit something outside the examples:

  • A div that won’t center

  • A z-index that does nothing

  • A layout that falls apart at 400 pixels wide

  • A gap under an image that you can’t explain and can’t remove

Then you’re guessing. Pasting into AI and hoping. Reading documentation that explains what a property does but not why yours isn’t working.

This course doesn’t teach properties. It teaches the system those properties live inside — and once you see that system, CSS stops being something you look up. It becomes something you reason about.


How is this course different?

Most courses start with syntax. This one starts with a reframe.

In Section 1 you don’t write a single line of CSS. You’re handed the actual problem: you have content, structured in HTML, and no way to show it the way you want. And the answer starts by throwing something away — we stop caring what elements mean. Every element on the page is a box.

That’s it. The whole problem becomes: how do you style a box? Everything after that is an answer to that question.

Section 2 — one box, completely

  • The box model — content, padding, border, margin. The foundation everything else sits on

  • Display — how a box behaves on the page, and why inline explains half the weirdness you’ve run into

  • Units — px, rem, em, %, vw, vh, and why you must never override the browser’s root font size

  • Color, backgrounds, and gradients — their own namespace, with their own rules

  • Typography — fonts are drawings. Every character is a vector illustration somebody drew, which is why a font weight nobody drew simply doesn’t exist

  • Overflow — what happens when content is bigger than the box holding it

Section 3 — selectors as a language

You cannot memorize a selector for every HTML structure that will ever exist, the same way you cannot memorize every sentence in English. So you learn the pieces and compose them yourself.

  • Where CSS lives — inline, embedded, external, and why inline doesn’t scale

  • The vocabulary — tag names, classes, IDs, attributes, the universal selector

  • The grammar — combinators, and how words become phrases

  • Pseudo-classes for when, pseudo-elements for which part of a box

  • The cascade and specificity — the reason styles feel random, until they don’t

  • CSS variables — declared once, used everywhere

Section 4 — layout and position, as one story

  • Normal flow — what the browser does before you change anything

  • Grid first, on purpose — declaring a structure and placing boxes into it is the more intuitive idea

  • Flexbox second — where the layout emerges from the items instead of being declared up front

  • Responsive design — media queries, container queries, and mobile-first as a default rather than a slogan

  • Position — for the things layout genuinely can’t solve

  • Stacking context — and why z-index sometimes does absolutely nothing

Section 5 — images, from computer science up

  • What a pixel actually is. PPI. Device pixel ratio

  • Raster versus vector, and why only one survives being scaled

  • JPEG, PNG, WebP, SVG — what each one optimizes for and when to reach for it

  • Responsive images with srcset and sizes

  • Replaced elements, object-fit, and why you always set width and height on an img

  • Visual effects — clip-path, mask, filter

Section 6 — animation

There is no such thing as animation. There are two states, and the frames between them are either drawn by you or calculated by a computer. That’s the entire subject.

  • Transitions — you define the two states, the browser draws everything in between

  • Keyframes — for when you want the waypoints yourself

  • Easing — the math describing how those in-between frames get drawn

  • Transforms, including real 3D with perspective

Section 7 — what the browser actually does

  • The rendering pipeline, opened up — every step between your stylesheet and the pixels on the glass

  • Why some animated properties are nearly free, and others make the whole page stutter

  • “Why is this janky” stops being a mystery and becomes a question with an answer

Section 8 — build real interfaces

No slides. I open a real website, look at it, and build it live.

  • No pre-built solution, and every wrong turn left in

  • Break the interface into boxes, capture the content, get the layout right, then chase the details until it matches

  • Then the same job goes to an AI, and we compare what came back

Every concept arrives as the answer to a problem you’ve already felt.


What’s inside

  • 8 sections, 40+ lectures that build on each other from a single reframe to fluent use

  • DevTools in every section — inspecting the box model, debugging specificity, measuring real elements on real pages

  • Pull assets straight out of production websites, and find out what fonts a real site is actually rendering

  • Compress real images and watch file size and quality move against each other

  • Rebuild a real interface from an empty file, live

  • MDN as your toolkit — by the end you can pick up a property you’ve never seen and know what to do with it

  • Every tool is free — VS Code, Chrome DevTools, Live Server, Squoosh


What you’ll walk away with

  • A complete working knowledge of the box model, display, units, color, backgrounds, and typography

  • The ability to target any element on any page with selectors you compose rather than copy

  • Grid and Flexbox, and the judgment to know which one a situation calls for

  • Responsive design as a decision rather than a set of breakpoints you copied from somewhere

  • A real understanding of images — pixels, formats, compression, and what to serve to whom

  • Animation as state, plus a working sense of what’s cheap to animate and what isn’t

  • A real interface, rebuilt by you from nothing

  • The foundation that makes JavaScript, TypeScript, and React click into place when you get there


The goal is not to cover properties. It’s to change how you look at a screen.

Once you see it clearly, CSS stops being a pile of rules you half-remember. Every interface you look at becomes something you could build — and everything you learn next sits on top of what you just built.

Click Enroll, and let’s finally make it click.

Who this course is for:

  • Anyone who knows HTML and wants CSS to finally make sense — as a system, not a list of properties.
  • Developers who can copy CSS that works but couldn't explain why it works.
  • Anyone who has fought a layout that wouldn't center or a z-index that did nothing, and is tired of guessing.
  • Self-taught developers and career switchers building a real foundation before JavaScript and React.
  • Anyone using AI to write CSS who wants to be able to judge what it hands back.
  • Not for you if you want a design course, a framework course, or a quick property reference.