Sub topic 8
Building a Z-pattern landing page
This chapter assumes you know basic HTML and CSS, including Flexbox and Grid, and the usual page parts: header, navigation, hero section and call to action (CTA). You should also know what the Z-pattern is from the previous chapter. Here you build a landing page whose layout follows it.
What the Z-pattern asks of your layout
The Z-pattern is a layout heuristic from print design. It describes a likely path across a sparse page with few competing elements. The eye travels in four steps:
- Along the top, from left to right.
- Diagonally down and back to the left.
- Along the bottom, from left to right.
- The scan ends at the bottom right.
Each corner of the Z is a place to put one job. The diagonal runs through the hero, so the headline and image sit on it.
| Z position | Typical content | Purpose |
|---|---|---|
| Top left | Logo | Identify the brand |
| Top right | Navigation or sign-in link | Offer a second path |
| Diagonal | Headline, short text, image | Explain the value |
| Bottom left | Proof, such as "Used by small teams" | Build trust |
| Bottom right | Call to action | Ask for one action |
Step 1: Build the frame
Start with a centered container and a header. A flex row with justify-content: space-between pushes the logo to the left edge and the navigation to the right edge. That makes the top bar of the Z.
.page { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.top, .bottom {
display: flex;
justify-content: space-between;
align-items: center;
}The .bottom rule reuses the same layout for the footer row. The bottom bar of the Z then mirrors the top bar.
Step 2: Build the diagonal
The hero is a two-column grid. Text goes in the left column and the image in the right. The reader's eye moves from the headline (upper left of the hero) to the image (right of it), and the whole hero sits between the top bar and the bottom bar.
.hero {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
align-items: center;
padding: 4rem 0;
}Generous padding matters here. Whitespace separates the hero from the bars, so each part of the Z reads as its own stop.
Step 3: Put the call to action where the Z ends
The scan ends at the bottom right, so the main CTA goes there. Style it with strong contrast so it stands out from the plain text links in the header.
The complete page
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
.page { max-width: 60rem; margin: 0 auto; padding: 1rem; }
.top, .bottom { display: flex; justify-content: space-between; align-items: center; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; padding: 4rem 0; }
.cta { padding: 0.75rem 1.5rem; background: #0b5fff; color: #fff; text-decoration: none; border-radius: 0.25rem; }
</style>
</head>
<body>
<div class='page'>
<header class='top'>
<a href='/'>Acme</a>
<nav><a href='/pricing'>Pricing</a> <a href='/login'>Log in</a></nav>
</header>
<main class='hero'>
<div>
<h1>Plan projects in minutes</h1>
<p>One shared board for tasks, deadlines and files.</p>
</div>
<img src='board.png' alt='Project board with three columns of tasks'>
</main>
<footer class='bottom'>
<p>Used by small teams worldwide</p>
<a class='cta' href='/signup'>Start free trial</a>
</footer>
</div>
</body>
</html>The markup follows the same order as the visual path: header, hero, footer. Screen reader users and keyboard users meet the content in the order a sighted reader does. Keep the DOM order and the visual order in step. Moving elements around with CSS order or absolute positioning can break that match.
Common errors
- Too many competing elements. The Z-pattern is a guide for sparse pages. If you add a sidebar, a carousel and three banners, readers stop following a Z. Cut elements until the path is clear.
- Several equal CTAs. If two buttons carry the same weight, the scan has no clear end. Give one primary style and make other actions plain links.
- The CTA only in the hero. Some readers do not follow the diagonal. Repeat the action at the end, as the footer row does here.
- Ignoring small screens. At narrow widths the grid should become one column, and the Z becomes a vertical sequence. Add a media query that sets
grid-template-columns: 1frbelow a breakpoint you choose, and test it.
Exercise
In the page above, which element marks the end of the Z, and why is it placed there? Name one change you would make so the layout still works on a phone.
Show answer
The "Start free trial" link (.cta) in the bottom-right corner of the footer row. The scan finishes there, so a reader who has followed the Z arrives at the main action. For phones, add a media query that changes .hero to grid-template-columns: 1fr so the text and image stack, and let the footer row wrap or stack so the CTA stays easy to find and tap.
Exercise
A landing page has a logo at top left, a hero on the diagonal, and two equally styled buttons, "Buy now" and "Book a demo", at the bottom right. What problem does this create, and how do you fix it?
Show answer
The scan ends with two equal choices, so the page has no single clear action. Pick the primary action and give it the filled, high-contrast button style. Restyle the other as a plain text link or an outline button.