Sub topic 3
Contrast: the mechanism behind emphasis
This chapter assumes you know basic design vocabulary (color, value, typeface) and can read simple CSS. You do not need to write CSS to follow the ideas. The earlier chapters defined visual hierarchy and the focal point. This chapter explains the mechanism that creates a focal point: contrast.
Emphasis is a difference, not a property
No element is emphasized on its own. A 32px heading is not strong in itself. It is strong when the text around it is 16px. Put the same heading among other 32px headings and it stops standing out.
Contrast is a perceivable difference between an element and its surroundings. Emphasis is the result of that difference. The eye is quick to notice what differs from its neighbors and slow to notice what matches them.
This leads to a working rule: to emphasize something, change it relative to its context, or change the context around it. Both approaches work. You can make a headline bigger, or you can make everything near it smaller or quieter.
The visual variables you can contrast
Designers have a limited set of variables that can differ. Each one can carry contrast.
| Variable | Weak contrast | Strong contrast |
|---|---|---|
| Size | 16px next to 18px | 16px next to 48px |
| Value (light to dark) | Mid-gray on light gray | Near-black on white |
| Hue and saturation | Two muted blues | One saturated red among muted grays |
| Weight | Regular next to medium | Light next to black |
| Shape | Rounded rectangle among rounded rectangles | A circle among rectangles |
| Texture and detail | Two similar photos | A detailed photo beside a flat field |
| Position and spacing | Evenly spaced items | One item set apart |
| Orientation | All horizontal | One rotated element |
The next chapters cover size, color, and type in detail. Here the goal is to understand the shared logic behind all of them.
How much difference is enough
Contrast has a threshold. Differences that are too small look like mistakes. Two headings at 20px and 22px do not read as a hierarchy. They read as sloppy inconsistency, because the viewer cannot tell whether the difference is intentional.
A useful habit is to make differences large enough to be unmistakable. Type designers often work with a scale, where each step is a fixed ratio larger than the last. A ratio of about 1.25 (a "major third") is a modest step. A ratio of 1.5 is a bold one. A step of 1.1 is usually too timid to carry emphasis.
Contrast also has a ceiling. Past a certain point, extra contrast adds little. A heading 12 times larger than body text is not much more noticeable than one 6 times larger, but it uses far more space and may break the layout.
The code example: contrast in three variables at once
The following CSS creates a card where three elements have three different roles. Read it as a comparison of values.
.card { max-width: 24rem; padding: 1.5rem; }
.card h2 { font-size: 2rem; font-weight: 700; color: #111; margin: 0 0 0.5rem; }
.card p { font-size: 1rem; font-weight: 400; color: #555; margin: 0 0 1.5rem; }
.card .cta { font-size: 1.125rem; font-weight: 600; color: #fff; background: #d62828; padding: 0.75rem 1.5rem; border: 0; border-radius: 0.25rem; }Compare the heading and the body text:
- Size: 2rem against 1rem, a ratio of 2.
- Weight: 700 against 400.
- Value:
#111(almost black) against#555(a mid-dark gray).
The heading wins on all three variables, so it leads the hierarchy. The body text is deliberately quieter. It stays readable but recedes.
The button does something different. Its size and weight are modest, but it is the only element with a saturated hue (#d62828, a strong red) and the only one with a filled background. Everything else on the card is neutral gray, so the red button becomes the focal point through hue and saturation contrast, not size.
Notice that the heading is not the focal point even though it is largest. The heading leads the reading order. The button is where the design wants action. Hierarchy and focal point can be different elements, and contrast lets you tune each one.
Contrast works by comparison with context
Because contrast is relative, the same element can gain or lose emphasis when its surroundings change. Two examples show this.
- A red button on a red-heavy page. If the header, images, and badges are also red, the button no longer differs from its context. The red that worked on a gray card now blends in.
- A small element on a quiet page. A 14px line of text can be the strongest element on a page where everything else is 12px and pale gray.
This is why you should evaluate emphasis in the finished layout, not in isolation. An element that looks bold in a mockup of one component can disappear once the whole page is assembled.
Combining variables
You can stack several variables on one element. A heading that is larger, bolder, and darker than the body text gets emphasis from three sources. Stacking makes emphasis reliable, because if one variable is weakened by the context, the others still work.
Stacking has a cost. Each added variable makes the element louder, and a loud element takes more attention from everything else. If you stack too many variables on too many elements, the page stops having a clear order. The chapter on competing emphases returns to this.
A practical guideline: use one strong variable for the focal point, and add a second only if the first is not enough. In the card above, the button uses mainly hue and saturation. The filled shape and padding give support, but they are not the main contrast.
Reducing contrast on purpose
Emphasis does not only mean making things louder. You can raise the focal point by lowering everything else. This is often the better choice, because it avoids a crowded, shouting page.
In the CSS above, the body text uses #555 instead of #111. That small drop in value pushes the paragraph back a step. It costs nothing in space, and it makes the heading and button stand out by comparison.
There is a limit. Text that is too light becomes hard to read. For body text, keep a contrast ratio of at least 4.5:1 against its background, which is the WCAG AA minimum for normal-size text. The color #555 on white has a ratio of about 7.5:1, so it passes comfortably. A pale gray such as #aaa on white is about 2.3:1 and fails.
Common errors
- Timid steps. Differences of a few pixels or a few shades read as inconsistency, not hierarchy. Make the difference clearly larger.
- Contrast on the wrong element. Strong contrast pulls the eye. If it lands on a decorative border or a stock photo instead of the message, the design points the viewer the wrong way.
- Relying on one variable that the context cancels. A color-only emphasis fails for viewers who cannot distinguish the hue, and fails when other elements share it. Back it up with value or size.
- Judging in isolation. Check emphasis in the full layout, with real content and neighboring elements.
- Using contrast everywhere. If every element contrasts with its surroundings, none of them does. Emphasis needs a quiet baseline to stand out from.
Checking contrast quickly
You can test whether your contrast holds without detail or hue. The CSS below applies a blur and a grayscale filter to a preview, which simulates a blur test and a value test.
.preview-blur { filter: blur(6px); }
.preview-gray { filter: grayscale(100%); }Add the class to the page's wrapper element, then look at the result. If the intended focal point is still the first thing you notice under blur, its contrast comes from size and mass. If it still stands out in grayscale, its contrast comes from value, not just hue. The red button on the card would likely fade in grayscale, because #d62828 has a mid-range value that sits close to the mid-gray text. That tells you the button relies on hue alone and may need a darker fill or a larger size for reliability. The final chapter of this tutorial covers these tests in full.
Summary of the mechanism
- Emphasis comes from difference between an element and its context.
- Contrast can be built from size, value, hue, weight, shape, texture, position, and orientation.
- Differences must be large enough to look deliberate.
- You can raise an element or lower its surroundings.
- Stacking variables makes emphasis more robust, but too much stacking creates noise.
- Quiet elements still need to be legible.
Exercise
A landing page has a green "Sign up" button. The header, the footer links, and three feature icons are also the same saturated green. Users rarely click the button. Using the idea of contrast, explain the likely cause and propose two different fixes.
Show answer
The button does not differ from its context. Because several other elements share the same saturated green, hue contrast no longer singles out the button. Fix 1: change the surroundings by recoloring the icons and footer links to a neutral or muted tone, so the green button is the only saturated element. Fix 2: change the button by adding contrast on another variable, for example a much darker fill with white text, a larger size, or extra whitespace around it. Either fix restores a clear difference between the button and its context.
Exercise
A page has a 20px subheading above 18px body text, both in dark gray. A reviewer says the hierarchy looks unclear. Why, and what would you change?
Show answer
The difference in size (20px against 18px, a ratio of about 1.1) is too small to read as deliberate, and the value and weight are the same. The viewer reads it as inconsistency. Increase the contrast, for example make the subheading 28px and weight 700 while keeping the body at 16px and weight 400, or lighten the body text slightly (while keeping at least 4.5:1 contrast against the background).
Exercise
In the card example, the heading is the largest element, but the red button is the intended focal point. Which variable gives the button its emphasis, and why does it work there?
Show answer
Hue and saturation. The button is the only saturated color on a card whose other elements are neutral grays and near-black. Its difference from the context is large on that one variable, so it draws the eye even though it is smaller and lighter in weight than the heading.