01 · Web Anatomy & The HTML Document
Understand how browsers parse HTML into the DOM tree, structure headings and prose, create safe links, and embed accessible lists and media.
- DOM tree
- <head> / <meta>
- headings h1–h6
- links / alt
End of HTML & CSS Moderno
Congratulations on reaching the end of HTML & CSS Moderno — 15 progressive modules spanning DOM semantics, WCAG accessibility, @layer/@scope architecture, Flexbox, CSS Grid/Subgrid, Top Layer <dialog>/Popover, <picture> media, Scroll Snap, and RTL logical properties.
15 modules · 60 lessons · 297 exercises
Every HTML & CSS challenge runs in a strict CSP sandbox with Tree-sitter CSS validation, WCAG A11y audits, and real iframe DOMRect geometry measurement at 375px / 768px / 1024px.
Understand how browsers parse HTML into the DOM tree, structure headings and prose, create safe links, and embed accessible lists and media.
Replace generic div soup with meaningful HTML5 landmarks, clean content sections, accessible tables, and zero-JS interactive widgets.
Master accessible form controls, explicit labels, native HTML validation, button semantics, focus order, and ARIA fundamentals.
Understand how selectors match DOM elements, compute specificity scores, resolve cascade conflicts, and scale architecture with @layer and :has().
Demystify padding, border, margin collapsing, border-box sizing, normal flow, overflow handling, viewport units, and intrinsic sizing.
Craft readable typography, accessible WCAG contrast palettes with oklch(), reusable CSS custom properties, and clean Light/Dark themes.
Master main vs cross axes, wrapping, flex-grow/shrink/basis math, min-width: 0 traps, and everyday navigation, card, and sticky-footer patterns.
Build deterministic two-dimensional grids using fractional tracks, media-free auto-fit minmax, named areas, and subgrid row synchronization.
Understand static/relative/absolute/fixed/sticky positioning, stacking contexts behind z-index bugs, mobile-first media queries, and @container.
Deliver smooth 60–120 FPS compositor animations with transform and opacity, natural easing curves, keyframe loaders, and prefers-reduced-motion.
Combine native CSS nesting (&), :has() state patterns, international logical properties (LTR/RTL), shadows/masks, and systematic bug hunting.
Apply semantic HTML5, WCAG contrast, design tokens, Flexbox, CSS Grid/Subgrid, @container queries, and logical RTL properties end-to-end.
Build zero-JS modals and popovers in the browser Top Layer with <dialog>, popover, ::backdrop, @starting-style, and rich native HTML form controls.
Serve crisp responsive imagery with <picture> and srcset, author accessible inline SVG, compose gradients/masks, and support print & High Contrast modes.
Prevent component style leakage with @scope donut limits, craft zero-JS scroll-snap carousels, optimize rendering with content-visibility, and audit A11y patterns.
Put the whole stack together cleanly: accessible landmarks & forms, @layer custom property theming, responsive Flexbox + Grid auto-fit layout, and RTL logical + sticky isolation.
Replace generic div soup and unlabeled controls with <main>, single <h1>, an alt-tagged hero image, and a properly associated <label for="subscriber-email">.
Update the markup to use a single <main>, one <h1>, an <img alt="..."> description, <label for="subscriber-email"> connected to <input id="subscriber-email">, and a <button type="submit"> with clear label text.
Swap <div class="page"> for <main class="page">, wrap the title in <h1>, add a descriptive alt="..." to <img>, connect <label for="subscriber-email"> to the input id, and turn the fake div CTA into <button type="submit">.
Solution available after 3 attempts
Organize the stylesheet with `@layer base, components;`, define `--accent` in `:root`, and apply high-contrast white ink `#ffffff` over `#0369a1`.
Declare @layer base, components; at the top, keep base box-sizing inside @layer base, style .cta inside @layer components using var(--accent) (#0369a1) as background-color and #ffffff text color.
Start with @layer base, components;, define :root { --accent: #0369a1; }, and set background-color: var(--accent); color: #ffffff; inside @layer components { .cta { ... } }.
Solution available after 3 attempts
Combine a wrapping `.site-nav` Flexbox bar with a responsive `.card-grid` using `repeat(auto-fit, minmax(220px, 1fr))` that avoids overflow at 375px.
Configure .site-nav with display: flex; flex-wrap: wrap; gap: 1rem; and .card-grid with display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem;.
Add * { box-sizing: border-box; } plus display: flex; flex-wrap: wrap; on .site-nav and display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); on .card-grid.
Solution available after 3 attempts
Fix a broken sticky header clipped by `overflow: hidden` by switching to `overflow: clip`, isolate the shell, and convert physical left spacing into `padding-inline-start` & `border-inline-start`.
Update .panel to use overflow-x: clip and isolation: isolate, .panel-head to use position: sticky; inset-block-start: 0;, and .callout to use padding-inline-start: 1rem; border-inline-start: 4px solid #0369a1;.
Replace overflow: hidden on .panel with overflow-x: clip; isolation: isolate; and swap physical left properties on .callout for padding-inline-start and border-inline-start.
Solution available after 3 attempts
Keep the searchable & printable HTML & CSS Moderno cheatsheet open alongside your projects.
Experiment freely with RTL layouts, Container Queries, Subgrid, and Box Outlines inside the sandbox playground — or test your debugging speed in CSS Layout Rescue.