liveBook · Manning

Alignment

As explained in Design for Developers

A visual design principle that positions elements along shared edges, axes, or guides.

Alignment positions elements along shared edges, centers, axes, or invisible lines. It establishes structure, creates relationships between items, and gives a page a more orderly, readable feeling. section 2.1.2 section 2.3

On the web, alignment is both a design decision and a layout concern. CSS Grid and Flexbox provide structural blueprints, but the principle guides how groups of content should relate rather than merely where a single element lands. section 2.1.2

Use alignment to make content feel like a coherent unit:

  • Choose a shared edge—left, right, top, or bottom—when elements should visibly belong together. section 2.1.2
  • Use vertical or horizontal center axes deliberately when centered content supports the intended structure. section 2.1.2
  • Consider text alignment alongside the bounding boxes of components; mixed alignment can make an otherwise aligned component feel less cohesive. section 2.1.2
  • Combine alignment with proximity, repetition, contrast, and balance to build visual hierarchy and help users scan relationships among content. section 2.1 section 2.3

Make a card collection feel orderly

A set of hotel cards can share a top edge yet still feel disjointed when hotel names are centered. Left-aligning each card’s content and placing the name below its image makes each component read more like a rectangle and creates a stronger sense of order. section 2.1.2

Figure 2.18 The bounding boxes of content are outlined to show that while elements can be aligned in one way, all our <div> elements—for example, mixing text alignment within those <div> elements—can have a noticeable effect on how cohesive a component feels.

Compare component bounding boxes with their internal text alignment to see why local alignment choices affect the cohesion of the whole component. section 2.1.2

Figure 2.24 Aligning all the content to the left and moving the hotel name below the image gives the illusion that each component is a rectangle and establishes a more orderly feeling on the page.

Use the card comparison to inspect how a shared left edge and consistent content placement establish an orderly component layout. section 2.1.2

How Design for Developers covers it

How deep it goes
Defines edge, center, group, and text alignment, relating the principle to CSS Grid and Flexbox without implementation detail.
Examples
Contrasts mixed and consistent component alignment and compares centered versus left-aligned hotel-card content.
What it assumes
Assumes familiarity with positioning page elements in code while treating visual design fundamentals as a foundation before wireframing.
What you can do after
Evaluate/understand how shared alignment lines create order, cohesion, and readable relationships in a page layout.
How it connects
Connects alignment with proximity, repetition, contrast, balance, visual hierarchy, CSS Grid, and Flexbox.

Also explained in

Compare how 4 books explain alignment →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Design for Developers. The section links point to the parts of the book it draws on.