Skip to main content

Interactive course

Modern HTML & CSS

From first semantic tags to resilient production layouts: master the DOM, WCAG accessibility, cascade & @layer, Box Model, Flexbox, CSS Grid & Subgrid, @container queries, fluid typography, and RTL logical properties.

01 · Web Anatomy & The HTML Document

4 lessons

Understand how browsers parse HTML into the DOM tree, structure headings and prose, create safe links, and embed accessible lists and media.

  1. 1.1How Browsers Read HTML & The DOM TreeTags, nested elements, attributes, <!DOCTYPE html>, and the <head> vs <body> split.~15 min
  2. 1.2Text, Headings & Document HierarchyLogical heading outline h1-h6, semantic emphasis, inline code, and blockquotes.~16 min
  3. 1.3Links, Navigation & URL PathsAnchor elements, relative vs root paths, fragment anchors, descriptive link labels, and safe new tabs.~16 min
  4. 1.4Lists, Images & Accessible MediaOrdered, unordered, and description lists, meaningful vs decorative alt text, aspect dimensions, and figures.~18 min

02 · Semantic HTML5 & Page Architecture

4 lessons

Replace generic div soup with meaningful HTML5 landmarks, clean content sections, accessible tables, and zero-JS interactive widgets.

  1. 2.1Beyond Div Soup: HTML5 LandmarksUse header, nav, main, and footer landmarks so keyboard and screen reader users jump anywhere fast.~16 min
  2. 2.2Article, Section & Aside Without OveruseDistinguish syndicatable <article> cards from thematic <section> regions and <aside> sidebars.~16 min
  3. 2.3Accessible Data Tables With Caption & ScopeStructure tabular data cleanly using caption, thead, tbody, and scoped th headers.~16 min
  4. 2.4Zero-JS Interactive HTML: Details & DialogBuild accessible disclosures, accordions, and dialogs with native HTML attributes before reaching for scripts.~17 min

03 · Forms, Validation & Practical Accessibility

4 lessons

Master accessible form controls, explicit labels, native HTML validation, button semantics, focus order, and ARIA fundamentals.

  1. 3.1Form Anatomy, Fieldset & Explicit LabelsPair inputs with <label for>, group related controls with fieldset/legend, and avoid placeholder anti-patterns.~17 min
  2. 3.2Input Types, Constraints & AutocompletePick semantic input types, select/textarea controls, required/minlength rules, and helpful autocomplete hints.~17 min
  3. 3.3Buttons vs Links, Keyboard Focus & ARIAUse <button> for actions and <a> for navigation, preserve focusability, and apply concise ARIA attributes cleanly.~18 min
  4. 3.4Track 1 Project: Fix an Inaccessible PageRefactor div-heavy markup and unlabeled forms into a compliant, screen-reader-ready semantic article page.~20 min

04 · CSS Selectors, Cascade & Specificity

4 lessons

Understand how selectors match DOM elements, compute specificity scores, resolve cascade conflicts, and scale architecture with @layer and :has().

  1. 4.1How CSS Works: Rules, Selectors & CombinatorsMatch type, class, id, attribute selectors, and descendant, child (>), and sibling (+, ~) combinators.~18 min
  2. 4.2Specificity & The Cascade: Who Wins & WhyCompute (ID, Class, Element) specificity tuples, understand source order, and avoid !important warfare.~18 min
  3. 4.3Inheritance, Pseudo-Classes, :is() & :where()Spot inherited properties vs box properties, style interactive focus states, and keep specificity low with :where().~19 min
  4. 4.4Cascade Layers (@layer) & The Parent Selector :has()Organize stylesheets deterministically with @layer and write parent-aware selectors cleanly using :has().~20 min

05 · The Box Model, Display & Modern Units

4 lessons

Demystify padding, border, margin collapsing, border-box sizing, normal flow, overflow handling, viewport units, and intrinsic sizing.

  1. 5.1The Box Model & box-sizing: border-boxInspect content, padding, border, and margin dimensions and adopt box-sizing: border-box globally.~18 min
  2. 5.2Normal Flow, Display, Margin Collapse & OverflowContrast block, inline, and inline-block layout, tame collapsing vertical margins, and control overflow safely.~19 min
  3. 5.3CSS Units: px, %, em, rem, ch, svh & dvhChoose rem for scalable UI, ch for prose measure, percentages for fluidity, and svh/dvh to dodge mobile viewport bugs.~18 min
  4. 5.4Intrinsic Sizing, min/max-width & Logical CenteringPrevent container overflow using max-width, min()/max(), fit-content, and margin-inline: auto.~18 min

06 · Color, Contrast, Typography & Design Tokens

4 lessons

Craft readable typography, accessible WCAG contrast palettes with oklch(), reusable CSS custom properties, and clean Light/Dark themes.

  1. 6.1Modern Colors (hsl, oklch) & WCAG ContrastUnderstand hex, rgb, hsl, and uniform oklch() color channels alongside WCAG 4.5:1 text contrast checks.~18 min
  2. 6.2Readable Type Stacks, Measure & Fluid clamp()Configure system font stacks, unitless line-height, 65ch line lengths, and smooth clamp() type scaling.~17 min
  3. 6.3CSS Custom Properties & Design Token SystemsDefine :root tokens, override values locally through cascade scope, and provide safe var() fallbacks.~18 min
  4. 6.4Light/Dark Themes Without JS & light-dark()Support system preferences and explicit theme switches cleanly via color-scheme and custom property tokens.~18 min

07 · Flexbox Layout in Depth

4 lessons

Master main vs cross axes, wrapping, flex-grow/shrink/basis math, min-width: 0 traps, and everyday navigation, card, and sticky-footer patterns.

  1. 7.1Main Axis, Cross Axis, justify-content & align-itemsOrient single-axis row and column layouts cleanly with gap, justify-content, and align-items.~20 min
  2. 7.2Wrapping Multi-Row Items & Accessibility Order CautionWrap tag groups gracefully with flex-wrap and align-content while keeping keyboard Tab order aligned with DOM order.~18 min
  3. 7.3flex-grow, flex-shrink, flex-basis & min-width: 0Calculate flexible width distribution cleanly and fix squished text/media inside flex items using min-width: 0.~22 min
  4. 7.4Real Flexbox Patterns: Navbars, Split Cards & Sticky FooterCombine margin-inline-start: auto, flex: 1, and min-height: 100svh into clean reusable page shells.~20 min

08 · CSS Grid Layout & Subgrid

4 lessons

Build deterministic two-dimensional grids using fractional tracks, media-free auto-fit minmax, named areas, and subgrid row synchronization.

  1. 8.1Grid Foundations: display: grid, fr Tracks & GapsDefine explicit column tracks with fr units, implicit auto rows, and consistent grid gaps.~20 min
  2. 8.2Intrinsic Responsive Grids: repeat(auto-fit, minmax())Create overflow-safe multi-column card galleries with zero media queries via min(100%, 260px) and auto-fit.~22 min
  3. 8.3Explicit Span, Line Numbers & grid-template-areasSpan bento cards with grid-column/row and compose readable dashboard shells using named grid areas.~22 min
  4. 8.4Grid Alignment & subgrid for Card Header/Footer SyncCenter with place-items, layer elements inside shared grid cells, and align sibling card bands via grid-template-rows: subgrid.~21 min

09 · Positioning, Stacking Context & Container Queries

4 lessons

Understand static/relative/absolute/fixed/sticky positioning, stacking contexts behind z-index bugs, mobile-first media queries, and @container.

  1. 9.1static, relative, absolute, fixed & sticky Without PitfallsAnchor floating badges onto relative parents, pin sticky toolbars safely, and dodge overflow: hidden traps.~20 min
  2. 9.2Decoding z-index, Stacking Contexts & isolation: isolateSpot why transform/opacity trap z-index: 9999 elements and isolate layers safely with isolation: isolate.~20 min
  3. 9.3Mobile-First @media, object-fit, aspect-ratio & pictureWrite progressive min-width breakpoints and crop responsive photography neatly via aspect-ratio and object-fit.~20 min
  4. 9.4Component-Driven Responsive Design with @container & cqiMake cards adapt to parent container width rather than browser screen size using container-type: inline-size.~20 min

10 · Transforms, Transitions & Accessible Motion

4 lessons

Deliver smooth 60–120 FPS compositor animations with transform and opacity, natural easing curves, keyframe loaders, and prefers-reduced-motion.

  1. 10.1Transforms & Compositor Performance (Reflow vs GPU)Use translate, scale, rotate, and transform-origin on the GPU compositor instead of triggering layout reflow.~18 min
  2. 10.2Smooth Transitions, cubic-bezier & Interactive Focus MotionAnimate hover/focus transitions intentionally with cubic-bezier timing and clear property lists instead of transition: all.~18 min
  3. 10.3Keyframe Animations, Fill Modes & Skeleton LoadersBuild looping status pulses, shimmer skeletons, and controlled entrance keyframes with animation-fill-mode: both.~18 min
  4. 10.4Accessible Motion & prefers-reduced-motionProtect vestibular-sensitive users by calming large movement inside @media (prefers-reduced-motion: reduce).~16 min

11 · Modern CSS Architecture, RTL & Debugging

4 lessons

Combine native CSS nesting (&), :has() state patterns, international logical properties (LTR/RTL), shadows/masks, and systematic bug hunting.

  1. 11.1Native CSS Nesting (&) & Form State Styling with :has()Write clean nested component rules natively and highlight error states or empty lists with zero JavaScript.~19 min
  2. 11.2CSS Logical Properties & Instant LTR/RTL SupportReplace physical left/right offsets with margin-inline-start, padding-block, inset-inline, and logical borders.~19 min
  3. 11.3Layered Shadows, backdrop-filter, clip-path & accent-colorCraft depth with dual-layer shadows, frosted glass headers, clean custom form tinting, and scrollbar-gutter stability.~18 min
  4. 11.4Systematic CSS Bug Hunting: Overflow, Flex Shrink & BleedDiagnose and eliminate phantom horizontal scrollbars, collapsing boxes, and squished flex media systematically.~19 min

12 · Real-World Capstone Projects

4 lessons

Apply semantic HTML5, WCAG contrast, design tokens, Flexbox, CSS Grid/Subgrid, @container queries, and logical RTL properties end-to-end.

  1. 12.1Capstone 1: Landing Hero & Pricing Grid With SubgridAssemble an accessible hero, responsive Flexbox navbar, and height-aligned Subgrid pricing comparison cards.~25 min
  2. 12.2Capstone 2: Sticky App Shell, Bento Grid & @container CardsBuild a multi-panel app dashboard with grid-template-areas, sticky navigation, dark mode tokens, and container-responsive widgets.~25 min
  3. 12.3Capstone 3: Zero-JS Accessible Checkout Form (LTR/RTL)Deliver a multi-section accessible checkout page with fieldset/legend, native pattern checks, :has() cues, and RTL logical spacing.~25 min
  4. 12.4Final Challenge: Refactor Legacy Div Soup to Modern CSSTransform a broken, rigid table/div legacy snippet into semantic HTML5 + modern @layer responsive CSS passing A11y & viewport checks.~25 min

13 · Top Layer UI, Popovers & Modern Forms

4 lessons

Build zero-JS modals and popovers in the browser Top Layer with <dialog>, popover, ::backdrop, @starting-style, and rich native HTML form controls.

  1. 13.1<dialog>, ::backdrop & The Browser Top LayerRender true accessible dialogs above every stacking context using native top-layer semantics and high-contrast ::backdrop styling.~20 min
  2. 13.2Zero-JS Popovers With popover & popovertargetCreate light-dismiss tooltips and explicit manual banners declaratively in HTML using popover="auto", "manual", and :popover-open.~18 min
  3. 13.3Animating Top Layer Panels With @starting-styleSmoothly fade in newly shown popovers and open dialogs using @starting-style, allow-discrete display transitions, and reduced-motion guards.~19 min
  4. 13.4Advanced Native Controls: datalist, meter, output & field-sizingPair <datalist>, <output>, <progress>, and <meter> semantics with field-sizing: content and :user-valid/:user-invalid states.~20 min

14 · Responsive Media, SVG, Visual Effects & Adaptive Modes

4 lessons

Serve crisp responsive imagery with <picture> and srcset, author accessible inline SVG, compose gradients/masks, and support print & High Contrast modes.

  1. 14.1Responsive <picture>, srcset, sizes & Art DirectionSwitch cropped hero assets across breakpoints via <picture> media rules alongside aspect-ratio and object-fit without layout shift.~20 min
  2. 14.2Accessible Inline SVG, viewBox & currentColorDistinguish decorative icons (aria-hidden="true") from informative vector charts (role="img" + title) and inherit theme ink via currentColor.~18 min
  3. 14.3Conic Gradients, mask-image, clip-path & Blend SurfacesCraft depth and directional fade-outs using conic/radial gradients, alpha masks, geometric clip-paths, and accessible ink overlays.~20 min
  4. 14.4Print Stylesheets, prefers-contrast & Windows forced-colorsKeep interfaces unmistakable in OS High Contrast (CanvasText/Highlight borders) and strip noisy navigation chrome when printing.~19 min

15 · CSS Architecture at Scale: @scope, Scroll Snap & Systems

4 lessons

Prevent component style leakage with @scope donut limits, craft zero-JS scroll-snap carousels, optimize rendering with content-visibility, and audit A11y patterns.

  1. 15.1CSS @scope & Donut Scoping (@scope to .slot)Bound component stylesheets strictly between a DOM root and embedded slot boundaries without resorting to BEM clutter or !important.~21 min
  2. 15.2Zero-JS Carousels With scroll-snap & scrollbar-gutterBuild smooth touch-friendly horizontal rails using scroll-snap-type, scroll-padding-inline, overscroll containment, and keyboard focusability.~20 min
  3. 15.3content-visibility: auto, :where() & :has() OrchestrationAccelerate initial render on long feeds with content-visibility and coordinate interactive parent states cleanly at zero specificity.~19 min
  4. 15.4Keyboard Skip Links, aria-live Patterns & Full System AuditCombine skip links, aria-live announcements, @layer, @scope, RTL logical spacing, and responsive container grids in a production audit.~25 min
Frequently asked questions

Modern HTML & CSS FAQ

How many lessons and hands-on exercises are in Modern HTML & CSS?

Modern HTML & CSS covers 15 modules, 60 interactive lessons, and 297 practical exercises (~19 hours total) with instant automated validation.

Do I need local setup or IDE installation for Modern HTML & CSS?

No installation required: every exercise and the interactive Modern HTML & CSS playground execute right in your browser via WASM and isolated sandboxes, with instant feedback.

Is Module 1 of Modern HTML & CSS free without creating an account?

Yes. Module 1 (“Web Anatomy & The HTML Document”), the live playground, and the printable cheatsheet are permanently free without signup, saving your progress locally in your browser.

Which career learning paths include Modern HTML & CSS?

Modern HTML & CSS is a core building block of Modern Frontend & Web Engineering, targeting roles such as Frontend Developer · UI Engineer · Full-Stack Web.