Font Weight and Pairing — UI/UX

font-weight sets how heavy letters are, from 100 to 900: 400 = Regular (normal), 500 = Medium, 600 = Semibold, 700 = Bold (bold). 2 to 3 weights (levels of…

In the previous lesson the hierarchy came from size: the homestay name at 36px, the room name at 24px. But a room card on a phone screen is narrow. There is no space to make anything bigger, and the room name still has to be read first.

The answer is in the thickness of the letters. Font weight (often just called weight) is written as a number from 100 (thinnest) to 900 (heaviest). With weight alone you can show people what to read first, without making anything bigger. Imagine the notice board at a small shop: the heading is written with a thick marker, the details with a pen. The letters are about the same size, but the eye goes straight to the marker. On a web page, the marker writing is text with a heavier weight. Font pairing (choosing two fonts to use together) is like choosing clothes: a batik shirt with plain trousers looks good because they contrast, which means they are clearly different. Two different batik patterns clash (look bad together). Fonts are the same: a good pair is two fonts that are clearly different.

The font-weight numbers

In CSS, the weight of the letters is set with font-weight. These are the values used most:

Value Name Used for
300 Light Calm large text, 24px and up
400 Regular Body text, paragraphs. Same as normal
500 Medium Subheadings, labels, menus
600 Semibold Small headings, emphasis
700 Bold Headings, buttons, strong emphasis. Same as bold

There are also 100 (Thin), 200 (Extra Light), 800 (Extra Bold) and 900 (Black), but an ordinary page rarely needs them. Each font has its own set of available weights: some fonts only have 400 and 700.

Hierarchy with weight: 2 to 3 weights

Here is Mrs. Sri's room card. Each paragraph (<p>) has a class (a name that CSS uses to pick it): .title for the room name, .subtitle for short details, and .body for the description. The hierarchy is made from font-weight:

<p class="title">Terrace Room</p>
<p class="subtitle">2 guests · queen bed · breakfast</p>
<p class="body">A first-floor room with a wooden terrace facing the potato garden.</p>

<style>
  .title { font-weight: 700; }    /* Bold: read first */
  .subtitle { font-weight: 500; } /* Medium: supporting info */
  .body { font-weight: 400; }     /* Regular: the content */
</style>

Three weights like this are enough for a whole website. The practical rule is 2 to 3 weights, for example 400, 500 and 700. If you use 300, 400, 500, 600, 700 and 800 all together, nothing feels most important any more.

Weight contrast has to be visible

Guess first: a subheading at weight 500 and body text at weight 400, at exactly the same size and colour. Can you see the difference?

Barely. A step of 100 (400 to 500) is hard to see when weight is the only difference. When only the weight differs, jump at least 200: 400 to 600, or 400 to 700.

The 500 subheading on Mrs. Sri's card still reads clearly because it also differs from the body in two other ways, size and colour:

.subtitle {
  font-weight: 500;
  font-size: 0.875rem; /* 14px, smaller than the body */
  color: #475569;      /* grey, calmer than the body */
}

Remove the differences one at a time. Without the colour, the subheading still looks different. Without the size too, only the 100 step is left, and the subheading almost merges with the body.

One more thing: thin weights (300 and below) need large sizes. The thin lines of the letters at 14px are easy to lose, especially on a dim screen. Use Light only for text of 24px and up.

Font pairing: contrast, not conflict

If you want two fonts, pick ones with clearly different characters. The safest pair: a serif for headings, a sans-serif for the body. A serif font has small feet at the ends of the lines of each letter (Georgia, Times). A sans-serif font has none (Arial, Inter, system-ui). In CSS you write the pair with font-family, on .title (the heading) and on body (all the content of the page). The second name (serif, sans-serif) is a backup for when the first font is missing:

.title { font-family: Georgia, serif; }      /* heading with feet */
body { font-family: system-ui, sans-serif; } /* body without feet */

⚠️ Weights that don't show up, and fonts that clash

TL;DR: font-weight sets how heavy letters are, from 100 to 900: 400 = Regular (normal), 500 = Medium, 600 = Semibold, 700 = Bold (bold). 2 to 3 weights (levels of thickness) per website is enough, for example title 700, subheading 500, body 400. When weight is the only difference, jump at least 200, because 400 and 500 look almost the same. Light (300) is for large text only. For pairing (choosing two fonts to use together), choose contrast (two clearly different fonts), not conflict (two similar fonts): a serif (letters with small feet) for headings with a sans-serif (no feet) for the body, or a single font with varied weights. Make sure the weights you use are actually loaded (downloaded) by the browser.

⚡ A hierarchy from weight

Write:

<p class="title">Terrace Room</p>
<p class="subtitle">2 guests · queen bed · breakfast</p>
<p class="body">A first-floor room with a wooden terrace facing the potato garden.</p>

<style>
  .title { font-weight: 700; }    /* Bold: read first */
  .subtitle { font-weight: 500; } /* Medium: supporting info */
  .body { font-weight: 400; }     /* Regular: the content */
</style>

Meaning: font-weight sets how heavy the letters are, from 100 to 900. On this room card, .title (the room name) is heaviest, so the eye catches it first. 400 is Regular (normal), 700 is Bold (bold). 2 to 3 weights (levels of thickness) per website is enough.

⚡ Jump at least 200

Guess first: a subheading at weight 500 and body text at weight 400, same size and same colour. Can you see the difference?

Barely. A step of 100 is hard to see when weight is the only difference.

Meaning: When only the weight differs, jump at least 200: 400 to 600, or 400 to 700. Light (thin, 300 and below) is for text of 24px and up only.

⚡ Pairing: contrast, not conflict

Write:

.title { font-family: Georgia, serif; }      /* heading with feet */
body { font-family: system-ui, sans-serif; } /* body without feet */

Meaning: Font pairing means choosing two fonts to use together, and they must have clearly different characters: a serif (letters with small feet, such as Georgia) for headings, a sans-serif (no feet) for the body. font-family picks the font for .title (the heading) and body (all the content of the page). The second name (serif, sans-serif) is a backup for when the first font is missing. Two similar fonts, like Verdana and Arial, look like a mistake. Not sure? Use one font.

What you will learn