30 Tailwind CSS Grid Layouts
08 / 30

All 30 in 30 Tailwind CSS Grid Layouts

  1. 01Tailwind Full-Bleed Article Layout for Long-Form Editorial
  2. 02Tailwind Docs Layout with Sticky Table of Contents
  3. 03Tailwind Photo Gallery Grid with auto-fill and Real Images
  4. 04Tailwind Holy Grail Page Layout for a News Site
  5. 05Tailwind Data Table with Subgrid Rows and Status Pills
  6. 06Tailwind Overlapping Card Hero for a Case Study
  7. 07Tailwind Help Center Layout with Fixed Sidebars
  8. 08Tailwind 12 Column Grid System for Marketing Pages
  9. 09Tailwind Bento Grid for a Product Feature Section
  10. 10Tailwind Magazine Spread Layout with Overlapping Headline
  11. 11Tailwind Responsive Card Grid for an Integrations Directory
  12. 12Tailwind CMS Category Grid that Compacts Itself with has()
  13. 13Tailwind Masonry Layout for a Saved Ideas Board
  14. 14Tailwind Hexagon Team Grid with clip-path Avatars
  15. 15Tailwind Subgrid Cards with Perfectly Aligned Buttons
  16. 16Tailwind Analytics Dashboard Layout with Grid App Shell
  17. 17Tailwind Pricing Table with Subgrid and a Featured Plan
  18. 18Tailwind Kanban Board with Scroll Snap Columns
  19. 19Tailwind Video Thumbnail Grid with Zero Layout Shift
  20. 20Tailwind Container Query Card for Reusable Article Teasers
  21. 21Tailwind Diagonal Section Band with skewY Counter-Skew
  22. 22Tailwind Asymmetric Poster Hero with Layered Grid Regions
  23. 23Tailwind Mosaic Photo Wall with a Designed Span Sequence
  24. 24Tailwind Dense Grid Packing for a Mixed-Size Asset Library
  25. 25Tailwind Onboarding Stepper with CSS Counters
  26. 26Tailwind macOS Window Layout with Vibrancy Sidebar
  27. 27Tailwind Scroll Snap Carousel with Peeking Slides
  28. 28Tailwind Status Map UI with Grid Coordinate Pins
  29. 29Tailwind Logo Wall with 1px Gap Hairline Dividers
  30. 30Tailwind Periodic Table Layout with Grid Coordinates
Pure TailwindMIT licensed

Tailwind 12 Column Grid System for Marketing Pages

A landing page assembled from a real 12-column system — hero, article, sidebar, three features, split CTA — with the design-tool column overlay rendered live behind the content so you can see every span land on its tracks.

Live Demo
Plain CSSTailwind v4
Try it

Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time

Untitled UI React · Affiliate link

Get Untitled UI Pro

The code

<section class="tgx-08 w-full min-h-svh bg-tgx08-paper font-tgx08-sans p-6">
  <div class="flex items-center justify-between gap-3 flex-wrap mb-3">
    <p class="font-tgx08-mono text-[0.68rem] tracking-[0.1em] uppercase text-tgx08-mut">Lumen · landing page skeleton</p>
    <p class="font-tgx08-mono text-[0.68rem] text-tgx08-mut">12 tracks · gap 12px · overlay on</p>
  </div>
  <div class="relative rounded-xl border border-tgx08-edge p-[var(--tgx08-gap)] bg-[repeating-linear-gradient(90deg,var(--tgx08-overlay)_0_calc((100%_+_var(--tgx08-gap))/12_-_var(--tgx08-gap)),transparent_calc((100%_+_var(--tgx08-gap))/12_-_var(--tgx08-gap))_calc((100%_+_var(--tgx08-gap))/12))] bg-origin-content bg-clip-content">
    <div class="grid grid-cols-12 gap-[var(--tgx08-gap)]">
      <div class="col-span-12 rounded-xl bg-tgx08-hero text-white p-6 flex flex-col gap-2.5">
        <p class="font-tgx08-mono text-[0.64rem] tracking-[0.16em] uppercase text-tgx08-herodim">span 12 · hero</p>
        <h2 class="text-[clamp(1.4rem,3.4vw,2.1rem)] leading-[1.1] font-semibold tracking-[-0.015em] text-balance">Ship the layout, not the framework</h2>
        <p class="text-[0.88rem] leading-[1.6] text-tgx08-herodim max-w-[54ch]">Twelve tracks, span utilities, and nothing else. The pink ruler behind this page is the same arithmetic your design tool draws.</p>
      </div>
      <article class="col-span-8 max-sm:col-span-12 rounded-xl bg-white border border-tgx08-blockedge p-5 flex flex-col gap-2">
        <p class="font-tgx08-mono text-[0.62rem] uppercase tracking-[0.12em] text-tgx08-indigo">span 8 · article</p>
        <h3 class="text-[1.02rem] font-semibold text-tgx08-ink">Why spans beat breakpoints</h3>
        <p class="text-[0.84rem] leading-[1.6] text-tgx08-mut">A span is a statement about proportion. A breakpoint is a guess about a device. Write the proportion, let the container decide when it stops working, and add exactly one variant.</p>
      </article>
      <aside class="col-span-4 max-sm:col-span-12 rounded-xl bg-tgx08-block border border-tgx08-blockedge p-5 flex flex-col gap-2">
        <p class="font-tgx08-mono text-[0.62rem] uppercase tracking-[0.12em] text-tgx08-indigo">span 4 · sidebar</p>
        <p class="text-[0.84rem] leading-[1.6] text-tgx08-mut">8 + 4 = 12. The row is full, so the next block starts a new one.</p>
      </aside>
      <div class="col-span-4 max-sm:col-span-6 rounded-xl bg-white border border-tgx08-blockedge p-4 flex flex-col gap-1.5">
        <span class="size-7 grid place-items-center rounded-lg bg-tgx08-block text-tgx08-indigo font-tgx08-mono text-[0.8rem]">↯</span>
        <h4 class="text-[0.9rem] font-semibold text-tgx08-ink">Fast by default</h4>
        <p class="text-[0.78rem] leading-[1.55] text-tgx08-mut">No runtime, no layout thrash.</p>
      </div>
      <div class="col-span-4 max-sm:col-span-6 rounded-xl bg-white border border-tgx08-blockedge p-4 flex flex-col gap-1.5">
        <span class="size-7 grid place-items-center rounded-lg bg-tgx08-block text-tgx08-indigo font-tgx08-mono text-[0.8rem]">◫</span>
        <h4 class="text-[0.9rem] font-semibold text-tgx08-ink">Readable spans</h4>
        <p class="text-[0.78rem] leading-[1.55] text-tgx08-mut">The layout is in the markup.</p>
      </div>
      <div class="col-span-4 max-sm:col-span-12 rounded-xl bg-white border border-tgx08-blockedge p-4 flex flex-col gap-1.5">
        <span class="size-7 grid place-items-center rounded-lg bg-tgx08-block text-tgx08-indigo font-tgx08-mono text-[0.8rem]">⇲</span>
        <h4 class="text-[0.9rem] font-semibold text-tgx08-ink">One gap token</h4>
        <p class="text-[0.78rem] leading-[1.55] text-tgx08-mut">Rhythm and ruler stay in sync.</p>
      </div>
      <div class="col-span-6 max-sm:col-span-12 rounded-xl bg-tgx08-block border border-tgx08-blockedge p-5 flex flex-col gap-2">
        <h4 class="text-[0.95rem] font-semibold text-tgx08-ink">Start with the grid</h4>
        <p class="text-[0.8rem] leading-[1.55] text-tgx08-mut">Copy the twelve-track container and build inward.</p>
      </div>
      <div class="col-span-6 max-sm:col-span-12 rounded-xl bg-tgx08-indigo text-white p-5 flex flex-col gap-2 justify-between">
        <h4 class="text-[0.95rem] font-semibold">Get the starter</h4>
        <a href="#0" class="w-fit inline-flex items-center min-h-11 px-4 rounded-lg bg-white text-tgx08-indigo text-[0.82rem] font-semibold no-underline transition-colors hover:bg-tgx08-block focus-visible:outline-2 focus-visible:outline-white focus-visible:outline-offset-2">Download</a>
      </div>
    </div>
  </div>
</section>
@import "tailwindcss";

@theme {
  --color-tgx08-paper: #f7f6fc;
  --color-tgx08-paper: oklch(0.97 0.008 280);
  --color-tgx08-edge: #ded9ee;
  --color-tgx08-edge: oklch(0.89 0.02 280);
  --color-tgx08-block: #edeafa;
  --color-tgx08-block: oklch(0.94 0.02 280);
  --color-tgx08-blockedge: #cdc6ec;
  --color-tgx08-blockedge: oklch(0.83 0.05 280);
  --color-tgx08-indigo: #5236b8;
  --color-tgx08-indigo: oklch(0.45 0.19 280);
  --color-tgx08-hero: #241a4d;
  --color-tgx08-hero: oklch(0.26 0.1 285);
  --color-tgx08-herodim: #c3bade;
  --color-tgx08-herodim: oklch(0.82 0.04 285);
  --color-tgx08-ink: #2c2545;
  --color-tgx08-ink: oklch(0.29 0.05 285);
  --color-tgx08-mut: #5f5880;
  --color-tgx08-mut: oklch(0.48 0.05 285);
  --font-tgx08-sans: 'Inter Tight', system-ui, sans-serif;
  --font-tgx08-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.tgx-08 {
  width: 100%;
  min-height: 100svh;
  --tgx08-gap: 12px;
  --tgx08-overlay: oklch(0.65 0.24 350 / 0.14);
}

Setup — do this once per project

Skip this if your project already runs Tailwind v4.

1Load Tailwind
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

Compiles in the browser — perfect for a CodePen or a quick test, not for production.

2Add the stylesheetRequiredthe @theme block is what makes the custom utilities exist
@import "tailwindcss";

@theme {
  --color-tgx08-paper: #f7f6fc;
  --color-tgx08-paper: oklch(0.97 0.008 280);
  --color-tgx08-edge: #ded9ee;
  --color-tgx08-edge: oklch(0.89 0.02 280);
  --color-tgx08-block: #edeafa;
  --color-tgx08-block: oklch(0.94 0.02 280);
  --color-tgx08-blockedge: #cdc6ec;
  --color-tgx08-blockedge: oklch(0.83 0.05 280);
  --color-tgx08-indigo: #5236b8;
  --color-tgx08-indigo: oklch(0.45 0.19 280);
  --color-tgx08-hero: #241a4d;
  --color-tgx08-hero: oklch(0.26 0.1 285);
  --color-tgx08-herodim: #c3bade;
  --color-tgx08-herodim: oklch(0.82 0.04 285);
  --color-tgx08-ink: #2c2545;
  --color-tgx08-ink: oklch(0.29 0.05 285);
  --color-tgx08-mut: #5f5880;
  --color-tgx08-mut: oklch(0.48 0.05 285);
  --font-tgx08-sans: 'Inter Tight', system-ui, sans-serif;
  --font-tgx08-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.tgx-08 {
  width: 100%;
  min-height: 100svh;
  --tgx08-gap: 12px;
  --tgx08-overlay: oklch(0.65 0.24 350 / 0.14);
}
3Fonts used by this demooptional — skip if you have your own type stack
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap">

What changed in the port

Which parts became utilities, which stayed CSS, and why.

  • Labelled grey boxes became a page you could actually ship: hero, article + sidebar, three features, split CTA. The span labels survive only where a block exists to demonstrate them.
  • 12 = 8 + 4 and 12 = 4 + 4 + 4 are now visible as real compositions rather than as a list of spans, which is what makes the wrapping rule (span 8 after span 6 leaves a hole) intuitive.
  • Product upgrade: added a dark hero and an indigo CTA so the ruler reads against both light and dark blocks, and the overlay legend moved into a header line.
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind 12 Column Grid System for Marketing Pages
Source: https://codefronts.com/layouts/tailwind-css-grid-layouts/tailwind-12-column-grid-system-marketing-pages/

A landing page assembled from a real 12-column system — hero, article, sidebar, three features, split CTA — with the design-tool column overlay rendered live behind the content so you can see every span land on its tracks.
## HTML
```html
<section class="tgx-08 w-full min-h-svh bg-tgx08-paper font-tgx08-sans p-6">
  <div class="flex items-center justify-between gap-3 flex-wrap mb-3">
    <p class="font-tgx08-mono text-[0.68rem] tracking-[0.1em] uppercase text-tgx08-mut">Lumen · landing page skeleton</p>
    <p class="font-tgx08-mono text-[0.68rem] text-tgx08-mut">12 tracks · gap 12px · overlay on</p>
  </div>
  <div class="relative rounded-xl border border-tgx08-edge p-[var(--tgx08-gap)] bg-[repeating-linear-gradient(90deg,var(--tgx08-overlay)_0_calc((100%_+_var(--tgx08-gap))/12_-_var(--tgx08-gap)),transparent_calc((100%_+_var(--tgx08-gap))/12_-_var(--tgx08-gap))_calc((100%_+_var(--tgx08-gap))/12))] bg-origin-content bg-clip-content">
    <div class="grid grid-cols-12 gap-[var(--tgx08-gap)]">
      <div class="col-span-12 rounded-xl bg-tgx08-hero text-white p-6 flex flex-col gap-2.5">
        <p class="font-tgx08-mono text-[0.64rem] tracking-[0.16em] uppercase text-tgx08-herodim">span 12 · hero</p>
        <h2 class="text-[clamp(1.4rem,3.4vw,2.1rem)] leading-[1.1] font-semibold tracking-[-0.015em] text-balance">Ship the layout, not the framework</h2>
        <p class="text-[0.88rem] leading-[1.6] text-tgx08-herodim max-w-[54ch]">Twelve tracks, span utilities, and nothing else. The pink ruler behind this page is the same arithmetic your design tool draws.</p>
      </div>
      <article class="col-span-8 max-sm:col-span-12 rounded-xl bg-white border border-tgx08-blockedge p-5 flex flex-col gap-2">
        <p class="font-tgx08-mono text-[0.62rem] uppercase tracking-[0.12em] text-tgx08-indigo">span 8 · article</p>
        <h3 class="text-[1.02rem] font-semibold text-tgx08-ink">Why spans beat breakpoints</h3>
        <p class="text-[0.84rem] leading-[1.6] text-tgx08-mut">A span is a statement about proportion. A breakpoint is a guess about a device. Write the proportion, let the container decide when it stops working, and add exactly one variant.</p>
      </article>
      <aside class="col-span-4 max-sm:col-span-12 rounded-xl bg-tgx08-block border border-tgx08-blockedge p-5 flex flex-col gap-2">
        <p class="font-tgx08-mono text-[0.62rem] uppercase tracking-[0.12em] text-tgx08-indigo">span 4 · sidebar</p>
        <p class="text-[0.84rem] leading-[1.6] text-tgx08-mut">8 + 4 = 12. The row is full, so the next block starts a new one.</p>
      </aside>
      <div class="col-span-4 max-sm:col-span-6 rounded-xl bg-white border border-tgx08-blockedge p-4 flex flex-col gap-1.5">
        <span class="size-7 grid place-items-center rounded-lg bg-tgx08-block text-tgx08-indigo font-tgx08-mono text-[0.8rem]">↯</span>
        <h4 class="text-[0.9rem] font-semibold text-tgx08-ink">Fast by default</h4>
        <p class="text-[0.78rem] leading-[1.55] text-tgx08-mut">No runtime, no layout thrash.</p>
      </div>
      <div class="col-span-4 max-sm:col-span-6 rounded-xl bg-white border border-tgx08-blockedge p-4 flex flex-col gap-1.5">
        <span class="size-7 grid place-items-center rounded-lg bg-tgx08-block text-tgx08-indigo font-tgx08-mono text-[0.8rem]">◫</span>
        <h4 class="text-[0.9rem] font-semibold text-tgx08-ink">Readable spans</h4>
        <p class="text-[0.78rem] leading-[1.55] text-tgx08-mut">The layout is in the markup.</p>
      </div>
      <div class="col-span-4 max-sm:col-span-12 rounded-xl bg-white border border-tgx08-blockedge p-4 flex flex-col gap-1.5">
        <span class="size-7 grid place-items-center rounded-lg bg-tgx08-block text-tgx08-indigo font-tgx08-mono text-[0.8rem]">⇲</span>
        <h4 class="text-[0.9rem] font-semibold text-tgx08-ink">One gap token</h4>
        <p class="text-[0.78rem] leading-[1.55] text-tgx08-mut">Rhythm and ruler stay in sync.</p>
      </div>
      <div class="col-span-6 max-sm:col-span-12 rounded-xl bg-tgx08-block border border-tgx08-blockedge p-5 flex flex-col gap-2">
        <h4 class="text-[0.95rem] font-semibold text-tgx08-ink">Start with the grid</h4>
        <p class="text-[0.8rem] leading-[1.55] text-tgx08-mut">Copy the twelve-track container and build inward.</p>
      </div>
      <div class="col-span-6 max-sm:col-span-12 rounded-xl bg-tgx08-indigo text-white p-5 flex flex-col gap-2 justify-between">
        <h4 class="text-[0.95rem] font-semibold">Get the starter</h4>
        <a href="#0" class="w-fit inline-flex items-center min-h-11 px-4 rounded-lg bg-white text-tgx08-indigo text-[0.82rem] font-semibold no-underline transition-colors hover:bg-tgx08-block focus-visible:outline-2 focus-visible:outline-white focus-visible:outline-offset-2">Download</a>
      </div>
    </div>
  </div>
</section>
```
## CSS
```css
@import "tailwindcss";

@theme {
  --color-tgx08-paper: #f7f6fc;
  --color-tgx08-paper: oklch(0.97 0.008 280);
  --color-tgx08-edge: #ded9ee;
  --color-tgx08-edge: oklch(0.89 0.02 280);
  --color-tgx08-block: #edeafa;
  --color-tgx08-block: oklch(0.94 0.02 280);
  --color-tgx08-blockedge: #cdc6ec;
  --color-tgx08-blockedge: oklch(0.83 0.05 280);
  --color-tgx08-indigo: #5236b8;
  --color-tgx08-indigo: oklch(0.45 0.19 280);
  --color-tgx08-hero: #241a4d;
  --color-tgx08-hero: oklch(0.26 0.1 285);
  --color-tgx08-herodim: #c3bade;
  --color-tgx08-herodim: oklch(0.82 0.04 285);
  --color-tgx08-ink: #2c2545;
  --color-tgx08-ink: oklch(0.29 0.05 285);
  --color-tgx08-mut: #5f5880;
  --color-tgx08-mut: oklch(0.48 0.05 285);
  --font-tgx08-sans: 'Inter Tight', system-ui, sans-serif;
  --font-tgx08-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.tgx-08 {
  width: 100%;
  min-height: 100svh;
  --tgx08-gap: 12px;
  --tgx08-overlay: oklch(0.65 0.24 350 / 0.14);
}
```

How this works

Tailwind already IS the grid system. The CSS original's selling point — twelve span utilities in twelve lines instead of a framework — is core behaviour here, so the port spends its effort on the part still worth writing: the overlay, and a page worth measuring.

The overlay is honest. Stripe width calc((100% + gap)/12 - gap) with period calc((100% + gap)/12) means the stripes land exactly on tracks at any width, and bg-clip-content keeps them inside the frame's padding.

Make it yours

  • Change --tgx08-gap once — tracks, rhythm and overlay follow.
  • 16-column dense layouts: grid-cols-16 and swap the two /12 divisors.
  • Delete the overlay utility in production; it is a ruler, not chrome.

Gotchas — read before shipping

  • Spans do not force new rows — a col-span-8 after a col-span-6 wraps and leaves a hole. Use col-start-1 to force a row start.
  • The overlay's calc() assumes uniform gaps; derive it from the column gap only if row-gap differs.
  • grid-cols-12 already emits minmax(0,1fr) tracks — hand-writing repeat(12,1fr) is a downgrade.

Browser support

ChromeSafariFirefoxEdge
111+16.4+128+111+

Core grid plus calc() in a gradient (2019+).

Techniques used in this demo

Arbitraryneeds bracket syntax

Search CodeFronts

Loading…