
Full-Bleed Layout
Published
30 hand-coded CSS grid layouts you can copy-paste into any project — full-bleed article grid, sticky sidebar shell, responsive media gallery with auto-fit + minmax(), modern holy grail template-area layout, dynamic data grid with quantity queries, card stack overlay, plus 24 field-tested patterns (12-column grid, Apple-style bento box, magazine editorial, Pinterest masonry, hexagonal honeycomb, subgrid card alignment, SaaS dashboard, pricing table, kanban board, aspect-ratio tiles, container-query cards, Mac app sidebar, scroll-snap slider, periodic table). Every layout is semantic HTML with real <header>/<nav>/<main>/<aside>/<footer> landmarks, uses gap instead of margins (survives reordering), and reaches for intrinsic sizing (minmax(), min(), clamp(), fit-content) instead of hardcoded pixels. Logical properties throughout (padding-block, inline-size, inset-inline-start) so every layout is RTL-ready. Modern platform: subgrid, container queries, :has() quantity queries, aspect-ratio, oklch() palettes, color-mix() tints — each gated by @supports where applicable so unsupported browsers get identical static content. Scoped under .cgl-NN for no-collision pasting, prefers-reduced-motion guarded, framework-agnostic.
Related15 CSS Flexbox Layouts15 CSS Card Grid Layouts30 CSS Sidebar Layouts20 CSS Blog Layouts

Published

Published

<figure> elements — the markup search engines and screen readers want.Published

Published

<table> styling pain.Published

Published

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

<ol> underneath, as the semantics demand.PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

Published
Tweak the exact look in our visual generators — no signup, instant copy-paste.
display: grid to position elements in two dimensions — rows and columns at the same time — using explicit tracks (grid-template-columns: 1fr 2fr 1fr), named areas (grid-template-areas), or auto-flowing patterns (repeat(auto-fit, minmax(240px, 1fr))). Reach for grid whenever your layout needs alignment across BOTH axes at once: a page shell with header / sidebar / main / footer, a card gallery that reflows across breakpoints, a magazine-style asymmetric editorial spread, a kanban board with fixed-height columns and free-height cards, a pricing table with tier-aligned features, a data dashboard whose widgets snap to a shared grid. Every demo in this collection is graded on four axes tier-1 (US/UK/CA/AU/NZ) devs actually care about: (1) MODERN CSS — subgrid, container queries, :has() quantity queries, aspect-ratio, min()/clamp() intrinsic sizing, grid-auto-flow: dense, oklch()/color-mix() palettes, logical properties for RTL. (2) SEMANTIC + ACCESSIBLE — every layout is real landmarks (<header>/<nav>/<main>/<aside>/<footer>) with <article> for cards and heading order preserved, focus-visible rings, 44px+ touch targets, prefers-reduced-motion guarded. (3) INTRINSIC SIZING — minmax(), min(), clamp(), fit-content replace hardcoded pixel widths so layouts survive any content length. (4) DROP-IN PORTABILITY — every demo scoped under .cgl-NN with tokenized colors so you can retune the palette by changing 3-6 CSS custom properties without touching layout math.grid-template-columns: repeat(12, 1fr) for the widget rail, and each widget spans grid-column: span N where N maps to its width tier — a KPI tile is span 3, a chart is span 6, a full-width activity feed is span 12. Widgets place with grid-auto-flow: dense so smaller tiles backfill holes when the layout wraps on medium screens. For the sidebar-nav shell wrap that outer widget grid in a two-column parent: grid-template-columns: 240px 1fr for the sidebar + main split, with @media (max-width: 768px) { grid-template-columns: 1fr; } to collapse the sidebar to a drawer on mobile. Linear, Notion, Vercel, Figma, Stripe Dashboard, and Airtable all ship variants of this exact recipe. Widget contents use nested flexbox for the label + value + delta arrangement so text metrics align across widgets.columns: 4 200px; column-gap: 12px; on a container and each item break-inside: avoid — which is Baseline everywhere and works today. Items fill top-to-bottom, then left-to-right (reading order breaks if that matters — check with a screen reader). (2) The newer grid-template-rows: masonry (Firefox has it behind a flag; Chrome + Safari have it as grid-template-rows: masonry in draft) — better reading order preservation but not Baseline-safe yet, so the demo ships CSS columns as the production path with a commented-out masonry rule as the forward-compat opt-in. For the CSS columns approach, if you need reading order to match visual order (accessibility + SEO signal for a portfolio), you have to reorder the DOM to match how columns pack items, which is exactly the trade-off masonry-grid was supposed to solve. Pinterest itself uses a JS-driven layout for exactly this reason; a CSS-only masonry is a good fit when reading order can be visual-column-major (photo galleries, illustration portfolios, mood boards).grid-template-rows: auto 1fr auto (title / body / footer tracks), and each CARD sets display: grid; grid-template-rows: subgrid; grid-row: span 3 — which makes the card's INNER rows lock onto the OUTER grid's row tracks. Every card's title-row aligns with every other card's title-row; body-rows flex together; footer-rows anchor at the same y-coordinate. Baseline widely-available (Chrome 117+, Safari 16+, Firefox 71+). This is the pattern shadcn card grids, Linear dashboard tiles, and every serious pricing table converges on — before subgrid, you'd either hardcode heights (broke on i18n) or use JS to measure and equalize (broke on hydration).repeat(auto-fit, minmax(240px, 1fr)) grid that wraps at any container width without media queries. For a full e-commerce product grid you'd nest inside each grid cell: an aspect-ratio: 4/5 media wrapper (product image), a title + price row (flex row with justify-content: space-between), a badge column (Sale / New / Bestseller), and a hover Add-to-Cart CTA that appears via :has(:hover). Shopify Dawn, WooCommerce Storefront, BigCommerce Stencil, Amazon product tiles, and Stripe Checkout item lists all use variants of this pattern. Combine with Demo 12 (Quantity Query) to change the visual density based on how many products are on screen: ul:has(> li:nth-child(4)) switches to a 4-column layout only when 4+ products exist; smaller counts get bigger tiles. This is the modern replacement for the JS-driven 'if fewer than 4 items, use different template' logic every e-commerce theme used to ship.margin-left, padding-right, left: 0, border-right-width. Logical: margin-inline-start, padding-inline-end, inset-inline-start: 0, border-inline-end-width. Grid tracks: use grid-column: 1 / -1 for spanning (works in both directions) instead of grid-column-start: 1. Sizing: inline-size / block-size instead of width / height when you're expressing 'the reading direction' vs 'the block direction' (they map to width/height in LTR and swap in RTL). Padding: padding-block and padding-inline. Set dir='rtl' on the root and the entire layout mirrors automatically — no per-selector overrides needed. The one gotcha: transform-based decorations (translate, rotate) don't auto-flip; wrap those in @media (dir: rtl) or explicit RTL selectors if the visual should mirror.aspect-ratio on media slots (Demo 19 Aspect-Ratio Tiles) so image containers reserve their height before the img loads — CLS penalty vanishes. (2) Use minmax() with a MIN large enough to fit your smallest realistic content but not so large it wastes space; e.g. minmax(240px, 1fr) for product cards, minmax(320px, 1fr) for dashboard widgets. (3) Avoid grid-auto-rows: auto when row heights depend on async data — pin them with grid-auto-rows: minmax(96px, auto) so the row reserves at least 96px even when data is still loading. Combine with the shimmer skeleton loader pattern (see CSS Shimmer Skeleton Cards) for zero-CLS async grids: the skeleton reserves the exact grid cell dimensions, then the real content swaps in without any reflow. Google's Core Web Vitals docks pages with CLS > 0.1; the aspect-ratio + minmax + shimmer combo keeps CLS at 0.<style> block, CSS Module, or scoped section. Next.js App Router: the layouts sit naturally in a layout.tsx file with <main> hosting the grid children. React Server Components: no hooks needed since these are pure CSS. Vue / Nuxt: drop into any <template> with scoped styles. Svelte / SvelteKit: works in a +page.svelte or +layout.svelte. Astro: paste directly into an .astro file's template. The class prefix .cgl-NN is per-demo scoped so you can drop multiple demos into the same project without collision. Because the layouts are pure CSS (no useEffect, no requestAnimationFrame, no state), you avoid the class of 'grid doesn't render server-side' bugs that plague JS-driven layout libraries — every demo works at first paint, no hydration required.15 hand-coded CSS aspect-ratio demos for video embeds, product galleries, IAB ad slots, native dialogs, and CLS-safe placeholders: 16:9 iframe YouTube embed with click-to-load facade + up-next rail, 21:9 full-screen hero video with min-height/max-height:100svh guardrails + Ken Burns drift, 1:1 Instagram-style square grid with 2×2 feature tile, 4:3 magazine card image cover, 9:16 vertical stories rail (TikTok/Reels/Shorts pattern) with scroll-snap + segment bars, 4:5 apparel product image gallery with radio-driven state + 1:1 thumbnails, 1:1 zoom thumbnail carousel with pointer-tracked --zx/--zy magnifier, prevent-layout-shift placeholder with live PerformanceObserver CLS meter (before/after side-by-side lab), dynamic content fallback with three policies (bend/strict/auto) via :has() toggle, IAB ad banner slots (728×90 leaderboard, 300×250 medium rectangle, 300×600 half-page, 320×50 mobile) with skeletons + container-query mobile swap, responsive modal dialog sized min(92vw, 88svh×16/9, 1080px) with @starting-style animation, responsive OpenStreetMap iframe wrapper with 16:9 → 1:1 container-query narrow swap, media query orientation live HUD + resize:both container-ratio playground, object-fit logo cloud with contain/cover/fill switcher via :has(), and side-by-side padding-top hack (height:0 + padding-top:56.25%) → modern aspect-ratio migration comparison with live ratio picker. 11 truly Pure CSS + 4 with a tiny optional vanilla JS snippet (facade swap, pointer magnifier, CLS meter, native dialog). Every demo is scoped under a unique .car-NN prefix so it drops into any project without CSS collisions, ships prefers-reduced-motion guards, and is framework-agnostic (works as-is in React, Vue, Svelte, Astro, Next.js, Remix, or plain HTML).
6 production CSS bento grid layouts with 12 hand-coded designs — Apple-style product showcase, SaaS feature value-prop matrix, analytics dashboard overview, creative portfolio, e-commerce category hub, and link-in-bio social hub. Each topic ships 2 sub-variants side-by-side so visitors see both a keynote aesthetic and a paper-doc variant at once. Container queries, CSS Grid, zero dependencies, copy-paste ready.
20 hand-coded CSS blog and editorial layouts for magazine homepages, news sites, personal archives, newsletter back-issues, recipe and podcast blogs, developer tutorials, and long-form journalism. Covers a magazine homepage with hero plus editor-picks rail, a news homepage with breaking-news ticker, blog archives with sticky year separators, Substack-style issue-numbered archives, recipe card grids with prep-time badges, podcast episode lists with waveforms, long-form articles with scroll-driven reading progress, drop caps and floated pull quotes via first-letter, Medium-style 65ch centred reader layouts, dev tutorials with a sticky code panel beside prose, interview transcripts with alternating speakers, case-study pages with stat counters, video blogs with an episode rail, full-bleed photo essays, news articles with sticky related-stories sidebars, documentation pages with prev/next chapter nav, a standalone blog post card, a scroll-snap category filter bar, an inline newsletter callout that breaks out of the prose column, and a horizontal featured-post rail. 12 are pure CSS with zero JavaScript. Every layout is scoped under a .bl-NN prefix for no-collision pasting, guards prefers-reduced-motion, and ports unchanged to React, Vue, Svelte, Astro, Next.js and Tailwind.