Sub topic 2
The axis, the center and the optical center
The previous chapter showed that every element has visual weight. This chapter covers where that weight is measured from. Balance needs a reference: a line the weight is distributed around and a point where the composition feels settled. Designers use three ideas for this: the axis, the geometric center and the optical center.
This chapter assumes you know what visual weight is and can use basic CSS. The Python example is short and uses only the standard library.
Balance as a lever
Think of a seesaw. The pivot is the fulcrum. A heavy child close to the pivot can balance a light child far from it. Visual balance follows the same logic:
- The fulcrum is the balance point of the canvas.
- Each element pushes down with its visual weight.
- The leverage of an element grows with its distance from the fulcrum.
This is a mental model, not physics. It still predicts real layouts well. A small, dark logo at the far edge of a page can offset a large, pale photograph near the middle, because distance multiplies weight.
The model needs two things you have to locate: a line or point to measure from (the axis and the center), and a point where viewers sense the middle (the optical center).
The axis
An axis is a line that divides the composition into parts that you compare for balance. It can be real or implied.
Common axes
- Vertical axis. It runs top to bottom through the middle of the canvas. It is the most important axis, because left and right weight is what most layouts need to equalize. Mirror symmetry (the next chapters cover it) is built on this axis.
- Horizontal axis. It runs left to right. Top and bottom weight also matters, but viewers tolerate top-to-bottom imbalance better. Most people expect a heavier base, such as a footer, a ground line or a thick title block at the bottom.
- Diagonal axes. They run corner to corner. A diagonal axis suggests movement and is a common way to create energy while keeping the balance.
- Local axes. These are lines inside the layout, not through the canvas center. A left-aligned column of text creates a strong vertical line along its left edge. The eye reads that edge as an axis, even though nothing is drawn there.
Implied axes
You rarely see an axis drawn. It appears when edges, centers or directions line up. Four things create one:
- A shared left, right or center alignment of several elements.
- The center line of a symmetrical shape, such as a face seen head on.
- The direction of a gaze or a pointing object.
- A gap that repeats between elements.
A page can have several implied axes at once. When they conflict, the viewer feels unease without knowing why. Two columns aligned to slightly different edges, for example, produce two competing axes. The usual fix is to pick one dominant axis and let the others support it.
The geometric center
The geometric center is the exact middle of the canvas: half the width and half the height. In a CSS box it is where the diagonals cross. Software measures from it, and "Align center" in design tools aligns to it.
It is easy to compute and not reliable as a target. An element placed exactly at the geometric center often looks too low. The reason is the next idea.
The optical center
The optical center is the point where viewers perceive the middle of a rectangle to be. It sits slightly above the geometric center. Several habits of perception explain why:
- People read from the top, so attention concentrates in the upper part of a page.
- Weight reads as downward pressure. Content at the exact middle appears to sag.
- Margins and frames usually have more mass at the bottom (footers, base lines), which pulls perceived balance down. The compensating center moves up.
A common rule of thumb places the optical center about 5% of the canvas height above the geometric center. Some traditional book design places it higher, by roughly an eighth to a tenth of the height. Treat these numbers as starting values to adjust by eye. No standard fixes them, and the right amount depends on the shape of the canvas and what else is on it.
Here is how the centers compare.
| Point | How to find it | Used for |
|---|---|---|
| Geometric center | Half the width, half the height | Alignment in software, measurement |
| Optical center | A little above the geometric center | Placing a single dominant element |
| Center of mass | The weighted average of all element positions | Judging overall balance |
| Focal point | Where the eye lands first | Emphasis and hierarchy |
The center of mass, sometimes called the visual centroid, is the point around which the total visual weight balances. A composition is balanced when its center of mass lands near the optical center. This definition works for symmetrical and asymmetrical layouts alike.
Computing a center of mass
You can estimate this point with arithmetic. Assign each element a weight and a position. Positions use normalized coordinates, where x runs from 0 (left) to 1 (right) and y runs from 0 (top) to 1 (bottom). Then take the weighted average, the way you would find a physical balance point.
# Estimate the visual center of mass of a layout.
# Coordinates are normalized: x from 0 (left) to 1 (right),
# y from 0 (top) to 1 (bottom).
OPTICAL_CENTER = (0.5, 0.45) # about 5% above the geometric center
elements = [
# (name, weight, x, y)
("headline", 5, 0.30, 0.25),
("photo", 8, 0.70, 0.55),
("caption", 2, 0.30, 0.85),
]
total = sum(weight for _, weight, _, _ in elements)
cx = sum(weight * x for _, weight, x, _ in elements) / total
cy = sum(weight * y for _, weight, _, y in elements) / total
dx = cx - OPTICAL_CENTER[0]
dy = cy - OPTICAL_CENTER[1]
print(f"center of mass: ({cx:.3f}, {cy:.3f})")
print(f"offset from optical center: dx={dx:+.3f}, dy={dy:+.3f}")Running it prints:
center of mass: (0.513, 0.490)
offset from optical center: dx=+0.013, dy=+0.040A positive dx means the weight leans right. A positive dy means it leans down, because y grows downward. Here the horizontal balance is nearly perfect. The layout sits a little low, about 4% of the height. You could move the caption up, lighten it, or raise the photo.
The weights are your own judgment, so the result is only as good as those numbers. Use the script to compare two versions of a layout, not to produce a verdict. The squint and flip tests in the last chapter of this tutorial check the same thing by eye.
Placing a single element
The simplest use of the optical center is a lone dominant element: a title on a cover, a logo on a splash screen, a headline in a hero banner. Centering it exactly looks low. Shift it up.
In CSS, centering a block with a grid and then adding bottom padding equal to twice the shift moves the content up by that shift. With the container's content box centered, extra bottom padding of 10vh moves the visual center up by 5vh.
.hero {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
/* Extra bottom padding shrinks the content box from below,
so the centered child moves up by half of this value (5vh). */
padding-block-end: 10vh;
text-align: center;
}<section class="hero">
<h1>Autumn Collection</h1>
</section>The padding trick keeps the layout flexible. The heading stays centered horizontally, stays optically centered on any screen height, and needs no absolute positioning. If you use a fixed offset in pixels instead, it will look right on one screen size and wrong on another.
A workflow for setting up axes and centers
Here is a repeatable way to apply these ideas when you start a layout.
In practice:
- Choose the dominant axis. Decide whether the layout hangs on a central vertical line, a left edge or a diagonal. Everything else will align to it.
- Mark the geometric center. Place guides at the halfway lines of the artboard.
- Shift up to the optical center. Add a second horizontal guide slightly above the first.
- Place the heaviest element. Put the element with the most visual weight near the optical center, or on the axis, or at a position that you will counterbalance.
- Check the center of mass. Add the other elements. If the weight drifts to one side, move or resize elements until the center of mass returns to the optical center.
Common errors
- Using the geometric center for everything. Content looks low and heavy. Start from the optical center for single focal elements.
- Confusing the axis with the center. The axis is a line, and the center is a point on it (or the point where two axes cross). A layout can be balanced around a vertical axis while the vertical position of the weight is wrong.
- Mixing several left edges. Three text blocks aligned to three slightly different x positions create three axes. Snap them to one.
- Ignoring the canvas shape. On a tall poster, a 5% shift moves content further in absolute terms than on a wide banner. Judge the result visually.
- Over-trusting the numbers. Weights are estimates. Use the calculation to compare options, then confirm by looking.
- Centering icons by their bounding box. A play triangle is centered in its box but looks pushed left, because its mass is concentrated at the wide edge. Nudge it toward the pointed side until it looks centered. This is the same optical correction at small scale.
Axis and center in the next chapters
Symmetrical balance mirrors weight across the vertical axis, so the center of mass lands on the axis automatically. Asymmetrical balance has no mirror, so it depends on the center-of-mass idea from this chapter: unequal weights placed at unequal distances from the center. Radial balance replaces the axis with a single point. Keep the lever model in mind, because the rest of the tutorial uses it.
Exercises
Exercise
A designer centers a logo exactly at the geometric center of a splash screen, and it looks too low. What is the cause, and what is a simple fix?
Show answer
Viewers perceive the middle of a rectangle slightly above the geometric center. This point is called the optical center. Moving the logo up by roughly 5% of the screen height, or by an amount that looks right by eye, fixes it. In CSS, adding bottom padding of twice that shift to a centered container does this and scales with screen height.
Exercise
Using the Python method from this chapter, suppose a layout has a "logo" of weight 4 at (0.2, 0.2) and a "banner" of weight 6 at (0.8, 0.7). Compute the center of mass. Which way does the layout lean compared with the optical center (0.5, 0.45)?
Show answer
Total weight is 10. cx = (4 × 0.2 + 6 × 0.8) / 10 = (0.8 + 4.8) / 10 = 0.56. cy = (4 × 0.2 + 6 × 0.7) / 10 = (0.8 + 4.2) / 10 = 0.50. The offset is dx = +0.06 and dy = +0.05, so the layout leans slightly right and slightly down. To correct it, move the banner left or up, or reduce its weight.