SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/layouts

6 CSS Layouts

6 Pure CSSPublished 2026-10-03Free · no sign-up

Page-level layout patterns you can drop into a real site: a split hero, the holy grail page structure, a bento feature grid, a card grid that picks its own column count, a sticky footer and a split-screen sign-in. Each is responsive and built with modern CSS Grid or Flexbox, with no framework.

01. Split Hero Section

Pure CSS

A landing-page hero with the headline, supporting text and two actions on one side and a visual panel on the other. It is a two-column grid that collapses to a single column on narrow screens with one media query, and the heading size scales smoothly with clamp() so it never overflows a phone.

View code
<section class="ttl-hero">
  <div class="ttl-hero-copy">
    <p class="ttl-eyebrow">New · Spring collection</p>
    <h1>Furniture that fits small spaces</h1>
    <p>Compact desks, shelves and storage built from solid oak. Free delivery on orders over $80.</p>
    <div class="ttl-hero-ctas"><a href="#" class="is-primary">Shop the range</a><a href="#">Book a room plan</a></div>
  </div>
  <div class="ttl-hero-art" aria-hidden="true"></div>
</section>
.ttl-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  width: min(100%, 860px);
  font-family: Inter, system-ui, sans-serif;
  color: #F5F7FA;
}
.ttl-eyebrow { margin: 0 0 10px; color: #7DA3FF; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ttl-hero h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 44px); line-height: 1.05; letter-spacing: -.03em; }
.ttl-hero p { margin: 0 0 20px; color: #A7AFBD; line-height: 1.6; }
.ttl-hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.ttl-hero-ctas a {
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  color: #F5F7FA;
  font-weight: 600;
  text-decoration: none;
}
.ttl-hero-ctas a.is-primary { border-color: transparent; background: #5B8CFF; color: #080A0F; }
.ttl-hero-art {
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 30%, rgba(125, 163, 255, .9), transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(139, 92, 246, .8), transparent 50%),
    #121722;
}
@media (max-width: 560px) {
  .ttl-hero { grid-template-columns: 1fr; }
  .ttl-hero-art { order: -1; }
}

02. Holy Grail Page Layout

Pure CSS

The classic page structure: header, navigation sidebar, main content, an aside and a footer, built with CSS Grid template areas. The layout is readable straight from the CSS, the footer stays at the bottom even with little content, and it stacks into one column on small screens by redefining the areas.

View code
<div class="ttl-grail">
  <header>Header</header>
  <nav>Navigation</nav>
  <main>Main content</main>
  <aside>Aside</aside>
  <footer>Footer</footer>
</div>
.ttl-grail {
  display: grid;
  grid-template-columns: 140px 1fr 120px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "nav    main   aside"
    "footer footer footer";
  gap: 10px;
  width: min(100%, 720px);
  min-height: 300px;
  font: 600 14px Inter, system-ui, sans-serif;
  color: #F5F7FA;
}
.ttl-grail > * { padding: 14px; border-radius: 10px; background: #1b2232; }
.ttl-grail header { grid-area: header; background: #5B8CFF; color: #080A0F; }
.ttl-grail nav { grid-area: nav; }
.ttl-grail main { grid-area: main; background: #121722; border: 1px dashed rgba(255, 255, 255, .2); }
.ttl-grail aside { grid-area: aside; }
.ttl-grail footer { grid-area: footer; background: #0E1118; border: 1px solid rgba(255, 255, 255, .1); }
@media (max-width: 560px) {
  .ttl-grail {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "nav" "main" "aside" "footer";
  }
}

03. Bento Grid

Pure CSS

A feature section in the bento style: tiles of different sizes packed into one grid, like compartments in a lunch box. Large tiles span two columns or two rows with grid-column and grid-row, and grid-auto-flow: dense fills the gaps. Below 560px every tile becomes full width.

View code
<section class="ttl-bento">
  <article class="is-wide"><h3>Live inventory</h3><p>Stock levels sync across every channel.</p></article>
  <article class="is-tall"><h3>Fast checkout</h3><p>One page, three fields.</p></article>
  <article><h3>Reports</h3><p>Daily sales by email.</p></article>
  <article><h3>Discounts</h3><p>Rules, not spreadsheets.</p></article>
  <article class="is-wide"><h3>Integrations</h3><p>Shopify, Amazon and your accounting tool.</p></article>
</section>
.ttl-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 96px;
  grid-auto-flow: dense;
  gap: 12px;
  width: min(100%, 720px);
  font-family: Inter, system-ui, sans-serif;
}
.ttl-bento article {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: #121722;
  color: #F5F7FA;
}
.ttl-bento .is-wide { grid-column: span 2; background: linear-gradient(135deg, rgba(91, 140, 255, .25), #121722 70%); }
.ttl-bento .is-tall { grid-row: span 2; }
.ttl-bento h3 { margin: 0 0 6px; font-size: 16px; }
.ttl-bento p { margin: 0; color: #A7AFBD; font-size: 13px; line-height: 1.5; }
@media (max-width: 560px) {
  .ttl-bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .ttl-bento .is-wide, .ttl-bento .is-tall { grid-column: auto; grid-row: auto; }
}

04. Responsive Card Grid Without Media Queries

Pure CSS

A product or blog grid that decides its own number of columns. repeat(auto-fill, minmax(160px, 1fr)) fits as many columns as there is room for, each at least 160px wide, so the same CSS gives one column on a phone and five on a wide monitor. Resize the editor preview to watch it reflow.

View code
<div class="ttl-cards">
  <div class="ttl-card"><span></span><b>Oak shelf</b><small>$64</small></div>
  <div class="ttl-card"><span></span><b>Desk lamp</b><small>$38</small></div>
  <div class="ttl-card"><span></span><b>Linen tray</b><small>$22</small></div>
  <div class="ttl-card"><span></span><b>Wall hook</b><small>$12</small></div>
  <div class="ttl-card"><span></span><b>Side table</b><small>$120</small></div>
  <div class="ttl-card"><span></span><b>Plant stand</b><small>$45</small></div>
</div>
.ttl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  width: min(100%, 760px);
  font-family: Inter, system-ui, sans-serif;
}
.ttl-card {
  display: grid;
  gap: 4px;
  padding: 10px 10px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px -12px rgba(15, 23, 42, .35);
}
.ttl-card span { aspect-ratio: 1; margin-bottom: 6px; border-radius: 10px; background: linear-gradient(135deg, #e8edf8, #cfd9f0); }
.ttl-card b { color: #0f172a; font-size: 14px; }
.ttl-card small { color: #64748b; font-size: 13px; }

06. Split Screen Sign-in Layout

Pure CSS

A two-panel sign-in screen: a brand panel with a short message on the left and the form on the right. The form has real labels, sensible autocomplete values and a 44px tall button. On phones the brand panel shrinks to a header above the form instead of disappearing.

View code
<div class="ttl-split">
  <aside class="ttl-split-brand"><b>Northwind</b><p>Manage orders, stock and returns in one place.</p></aside>
  <form class="ttl-split-form" onsubmit="return false">
    <h2>Sign in</h2>
    <label for="ttl-email">Email</label>
    <input id="ttl-email" type="email" autocomplete="email" placeholder="you@company.com">
    <label for="ttl-pass">Password</label>
    <input id="ttl-pass" type="password" autocomplete="current-password">
    <button type="submit">Sign in</button>
  </form>
</div>
.ttl-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 720px);
  min-height: 340px;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 40px -24px rgba(15, 23, 42, .45);
  font-family: Inter, system-ui, sans-serif;
}
.ttl-split-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  background: linear-gradient(160deg, #5B8CFF, #8B5CF6);
  color: #fff;
}
.ttl-split-brand b { font-size: 22px; }
.ttl-split-brand p { margin: 6px 0 0; opacity: .9; }
.ttl-split-form { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 28px; }
.ttl-split-form h2 { margin: 0 0 8px; color: #0f172a; }
.ttl-split-form label { color: #334155; font-size: 13px; font-weight: 600; }
.ttl-split-form input { height: 42px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; }
.ttl-split-form input:focus { outline: 2px solid #5B8CFF; outline-offset: 1px; border-color: #5B8CFF; }
.ttl-split-form button { height: 44px; margin-top: 8px; border: 0; border-radius: 10px; background: #0f172a; color: #fff; font: 700 15px Inter, system-ui, sans-serif; cursor: pointer; }
@media (max-width: 560px) {
  .ttl-split { grid-template-columns: 1fr; }
  .ttl-split-brand { padding: 20px; }
}

About these CSS Layouts

Grid for pages, flexbox for rows

Most page layouts are two-dimensional: rows and columns both matter, which is what CSS Grid is for. Flexbox is better for one direction at a time, such as a row of buttons or a header bar. These demos use grid for the overall structure and flexbox inside components, the combination most production sites use.

Responsive without many media queries

Modern CSS can adapt on its own. repeat(auto-fill, minmax(160px, 1fr)) chooses the column count, clamp() scales headings between a minimum and maximum, and flex-wrap lets rows break naturally. The demos add a single media query only where the layout truly changes shape.

Named areas are readable

grid-template-areas lets you draw the layout in the CSS as text, as in the holy grail demo. Anyone reading the stylesheet can see the structure at a glance, and changing the layout for phones means rewriting a few quoted strings instead of repositioning every element.

Keep source order logical

Grid and flexbox can place elements anywhere visually, but screen readers and keyboard users follow the HTML order. Keep the markup in a sensible reading order and use visual reordering, such as moving the hero image above the text on phones, only for small adjustments.

Frequently asked questions

Do these layouts need a framework?

No. They are plain HTML and CSS and work in every current browser.

How do I use a layout on a real page?

Copy the HTML and CSS, then replace the placeholder content. Where a demo uses a fixed height for the preview, the CSS comment shows what to use on a real page, such as min-height: 100dvh.

Can I combine them?

Yes. The split hero, the card grid and the sticky footer are designed to sit together on one page.