Please enable JavaScript to use CodeHS

Web Design — Visual Design

Layout and spacing

Layout decides where things go. Spacing decides how close or far apart they feel. Together they turn a pile of content into a clean, organized page that guides the eye.

Layout ~10 min Middle / High School
The Big Idea

What is layout?

Layout is the arrangement of elements on a page. It answers questions like: where does the navigation go? How wide is the content? Where do images sit relative to text? A clear layout helps users know what to read first and where to click.

Good layout is not about making things fancy. It is about making relationships clear. Things that belong together should be close. Things that are different should be separated.


Vocabulary

Grids and columns

A grid is an invisible set of columns and rows that content lines up with. Grids make layouts consistent. A common approach is a 12-column grid: you can split the page into halves, thirds, quarters, and so on.

Columns help create responsive designs. On a wide monitor, a page might show three cards side by side. On a phone, the same cards stack in one column. The grid adapts, but the underlying structure stays the same.


Design Skill

White space

White space (also called negative space) is the empty space around and between elements. It is not wasted space. It gives content room to breathe and helps users focus.

Pages with too little white space feel cluttered and overwhelming. Pages with too much can feel empty or disconnected. The goal is enough space to separate sections, but not so much that the page feels scattered.


Critical Thinking

Alignment and balance

Alignment creates order. When edges line up, the page feels intentional. When elements are randomly placed, the page feels messy even if each element is fine on its own.

Balance does not mean perfect symmetry. It means the visual weight feels even. A large image on one side can be balanced by a block of text on the other. Asymmetrical layouts can be more interesting than perfectly centered ones.

Tip: pick a few alignment lines and stick to them. Left-aligned text is usually easiest to read in English. Center alignment works for short headings but can tire the eye in long paragraphs.


Interactive

Layout sandbox

Adjust the number of columns and the gap to see how the same boxes feel different. Notice how spacing changes the rhythm of the page.

1
2
3
4
5
6

Code

A flexbox layout

Good layout separates content and gives it room to breathe. This CSS uses flexbox to place a navigation bar and content side by side.


Your Turn

Check yourself

Look at a website you visit. How does it use white space? Does it have a clear grid? What would change if everything were pushed closer together?

Your answer:

Sample answer: A clean shopping site probably uses a lot of white space around products and keeps images aligned in a grid. If the gap shrank, the page would feel crowded and harder to scan.


Check Yourself

Quick quiz

1. What is a grid used for in web design?

2. Why is white space important?

3. What does alignment do?

Keep learning

You can organize a page with grids and spacing. Next, learn how hierarchy and contrast guide attention.

Part of the Web Design: Visual Design series.