Visual Hierarchy, Spacing and the 8-Point Grid: Tell the Eye What to Read First
A newspaper tells you where to look first. Learn the four tools of visual hierarchy, the 8-point spacing scale and proximity, then fix a cluttered workshop card by changing only its CSS.
What you will learn
- Use size, weight, colour and position to give a screen one clear hero
- Pick every gap from the 8-point scale: 8, 16, 24, 32, 48
- Group related items with proximity: small gaps inside, big gaps between
- Fix a cluttered card by changing only the CSS
Before you start
- Basic HTML and CSS
Look at a newspaper front page for one second. You already know what to read first. The headline is the biggest, boldest thing on the page, so your eyes go there. The subheading is smaller and lighter and adds one detail. The small print comes last, and you only read it if you want more.
A screen works exactly the same way. You decide what is read first, second and last. That order is called visual hierarchy, and together with spacing it is the difference between a card that feels calm and one that feels like noise.
Four ways to make one thing stand out
You have four tools to build that order:
- Size. Bigger things are read first.
- Weight. Bold is heavier than light, so bold is read first.
- Colour. A strong colour, like an accent blue, pulls the eye. Grey steps back.
- Position. Top and left are read first. Bottom right is read last.
The trick is to use them on one thing only. If everything is loud, nothing is.
One card, two stylesheets
Here is a real example: a workshop card with a tag, a title, a date, a host, a short description, a price and a button. The HTML is the same for both versions:
<article class="card">
<span class="tag">New</span>
<h2 class="title">Weekend Design Workshop</h2>
<p class="meta">Sat 14 March · 10:00 · Leeds</p>
<p class="host">Hosted by Emma Clarke</p>
<p class="desc">Learn to lay out a page so people know what to read first. Bring a laptop.</p>
<div class="foot">
<span class="price">$49</span>
<button class="book">Book a seat</button>
</div>
</article>
Now two stylesheets. First before.css, cluttered on purpose:
/* BEFORE: everything is the same size, weight and colour, and the gaps are random. */
.card { width: 380px; box-sizing: border-box; padding: 13px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; font: 600 16px/1.3 system-ui, sans-serif; color: #1e293b; }
.card .tag { display: inline-block; margin-bottom: 5px; }
.card .title { margin: 0 0 11px; font-size: 16px; }
.card .meta { margin: 0 0 3px; }
.card .host { margin: 0 0 19px; }
.card .desc { margin: 0 0 7px; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.card .price { font-size: 16px; }
.card .book { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 4px; background: #e2e8f0; font: inherit; color: #1e293b; }
Every text is 16px, the same weight and the same colour. The gaps are random: 13 here, 5 there, 11, 3, 19. Where do you look? Nowhere in particular.
And after.css:
/* AFTER: one thing is big, the rest is quiet, and every gap is a multiple of 8. */
.card { width: 380px; box-sizing: border-box; padding: 24px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; font: 400 16px/24px system-ui, sans-serif; color: #334155; }
.card .tag { display: inline-block; margin-bottom: 8px; font-size: 14px; font-weight: 700; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; color: #4f46e5; }
.card .title { margin: 0 0 8px; font-size: 28px; font-weight: 800; line-height: 32px; color: #0f172a; }
.card .meta { margin: 0; color: #64748b; }
.card .host { margin: 0 0 24px; font-size: 14px; color: #64748b; }
.card .desc { margin: 0; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.card .price { font-size: 32px; font-weight: 800; line-height: 40px; color: #0f172a; }
.card .book { height: 48px; padding: 0 24px; border: 0; border-radius: 8px; background: #4f46e5; font: 700 16px system-ui, sans-serif; color: #fff; cursor: pointer; }
.card .book:hover { background: #4338ca; }

The title comes first, then the price, then the button. The date, place and host stay quiet in grey. Same words, but now there is an order. The HTML did not change at all. Only the CSS did.
Every gap is a multiple of 8
Designers use a simple rule for spacing called the 8-point grid: every gap, every padding and every margin is a multiple of 8.
Check after.css against it. The card padding is 24. The tag has 8 below it, the title 8, the host 24, and the price row 24 above it. Even the line height is 24px, and the button is 48px tall. Every value lands on the scale, so the card feels calm and tidy, even if you cannot say why. This takes the guesswork out of spacing.
Close together means related
One more idea, and it is a very important one: proximity. Take a checkout panel with a delivery address and a payment card.
On the left, nothing looks grouped. You have to read every line to find out what belongs together. On the right you see two groups, delivery and payment, without reading a word. The rule is simple: related things close, unrelated things far.
Four changes fix the cluttered card
Back to the workshop card. Going from before.css to after.css is four steps:
- Pick the hero.
.title { font-size: 28px; }and bold. Right away, the eye knows where to start. - Quiet the rest.
.meta { color: #64748b; }. The date, host and description turn grey and lighter. The tag becomes small capitals, and the price and the button get their own strength. - Use the 8 scale.
.card { padding: 24px; }, and every margin becomes 8, 16 or 24. - Group by distance.
.foot { margin-top: 24px; }. The details stay close together, and the price row gets room above it.
Four small changes, and the HTML stayed the same.
Common mistakes
- Two heroes. A huge title and a huge price and a bright button all fighting. Pick one first, one second.
- Grey everything. Quiet details are good. Quiet buttons are not. The main action needs its own strength.
- Odd numbers that "look right". 13px here and 17px there feels fine on one card and messy across an app. Take the value from the scale.
- Equal gaps everywhere. Equal spacing hides the groups. Use a small gap inside and a big gap between.
Run this check on every screen
One hero per screen. Quiet details. One main button. Gaps from 8, 16, 24, 32. Related items close together. You can give the same check to AI. Paste this into your prompt:
Review this screen: what is the first thing the eye reads? Is there one clear primary action? Are all spacing values multiples of 8? Are related items closer to each other than to unrelated ones? List what to fix, then fix it.
Recap
| Idea | Rule |
|---|---|
| Hierarchy | One hero, built with size, weight, colour or position |
| Spacing | Multiples of 8: 8, 16, 24, 32, 48 |
| Proximity | Close means related, far means separate |
You do not have to memorise every value. Learn these foundations so you know what to ask for, and AI can generate the rest. To review a whole AI-built screen, use the six-check critique. Next, the same thinking applied to colour in colour, contrast and dark palettes.
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
One Request, Two Answers: the Same Post as an HTML Page and as JSON
Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.
A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.
How a Web Page Works: HTML Tags, Elements and Attributes
A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.
Semantic HTML: header, nav, main, aside and footer as Page Landmarks
The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.
