Sub topic 2
Grids, spacing, and alignment
This chapter assumes you can read a basic wireframe, name common interface parts such as headers, menus, and forms, and write simple CSS. It covers grids, visual hierarchy, standard components, navigation, and responsive breakpoints.
Grids and spacing
A layout grid divides the screen into equal columns separated by gutters. Mobile layouts often use 4 columns, tablets 8, and desktops 12. Set spacing in multiples of one base unit, usually 8 px, so gaps look consistent. Align each element to a column edge or gutter.
.wf-box { border: 1px solid #888; background: #f2f2f2; padding: 8px; }
.wf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wf-main, .wf-side { grid-column: 1 / -1; }
@media (min-width: 768px) {
.wf-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (min-width: 1024px) {
.wf-grid { grid-template-columns: repeat(12, 1fr); gap: 24px; }
.wf-main { grid-column: span 8; }
.wf-side { grid-column: span 4; }
}Visual hierarchy
Readers scan for the largest, darkest, or most central element first. Give each screen one clear heading and one primary action. In a grayscale wireframe, use size, position, and box weight to rank content.
Standard components and patterns
Use familiar controls such as buttons, text fields, lists, cards, and tabs. Users already know how these behave, so unusual controls add learning cost. Label each control with its real result, such as "Place order" instead of "Go".
Navigation patterns
Apps often place three to five destinations in a bottom tab bar. Websites usually place a primary menu in a top bar and filters or secondary sections in a sidebar. Keep the same destinations in the same order on every screen.
Responsive layouts and breakpoints
A breakpoint is a screen width where the layout changes. The CSS above moves from 4 to 8 to 12 columns at 768 px and 1024 px. Below 1024 px, the sidebar stacks under the main content.
Exercise
At 1024 px wide, how many columns does the grid use, and how many columns does the sidebar span?
Show answer
The grid uses 12 columns. The sidebar spans 4 columns, and the main area spans 8.