Holy grail layout

홀리 그레일 레이아웃

The classic five-region page: header, left nav, main content, right sidebar, footer.

Also known as: Header-nav-main-aside-footer
···
html
<div class="grail" id="grail">
  <header>header</header>
  <nav>nav</nav>
  <main>main</main>
  <aside>aside</aside>
  <footer>footer</footer>
</div>
css
.grail{width:min(94%,540px);height:min(92%,260px);display:grid;gap:6px;
  grid-template-areas:"h h h" "n m a" "f f f";
  grid-template-rows:16% 1fr 16%;grid-template-columns:22% 1fr 22%}
.grail>*{display:grid;place-items:center;border-radius:8px;background:var(--surface);border:1px solid var(--line);
  color:var(--muted);font-size:clamp(9px,1.6vmin,12px);letter-spacing:.08em;text-transform:uppercase;
  transition:box-shadow .3s,color .3s,border-color .3s}
header{grid-area:h}nav{grid-area:n}main{grid-area:m}aside{grid-area:a}footer{grid-area:f}
.grail>*.active{color:var(--bg);border-color:transparent;background:var(--accent);
  box-shadow:0 6px 18px color-mix(in oklab,var(--accent) 45%,transparent)}
js
const grail = document.getElementById('grail');
const parts = grail.querySelectorAll('*');
let i = 0;
setInterval(() => {
  parts.forEach((p) => p.classList.remove('active'));
  parts[i % parts.length].classList.add('active');
  i++;
}, 1000);

The "holy grail" nickname comes from how hard this used to be with tables and floats — matching the side columns' height to the main content was notoriously fiddly. Flexbox and CSS Grid turned it into a few lines of code.

With Grid the clearest way is a grid-template-areas of "header header header" / "nav main aside" / "footer footer footer". Because areas don't have to follow source order, you can also push nav below main on mobile without reordering the markup.

Today it's cited more as a teaching example of how cleanly Grid solves an old problem than as a layout people build as-is — real products more often drop the sidebar or keep nav only in the header.

When to use

Good for document-style sites (wikis, admin panels) with clearly separate nav, content and secondary info. Content-first products often work better with a simpler, sidebar-free structure.