Course contentsShow
← Web Development
Lesson 167 of 2,9823. CSS FundamentalsFree lesson

Font Weight and Font Style

Control text boldness with font-weight and apply italic or oblique styles with font-style.

Font Weight and Font Style

You'll learn how to control whether text is bold or italic — two fundamental ways to emphasize content.

What Are Font Weight and Font Style?

These are two separate CSS properties that change how text looks without changing what it says. Think of them like formatting buttons in a word processor: one makes text bolder or lighter, the other tilts it to the side for emphasis.

Font Weight: Controlling Boldness

The font-weight property controls how thick or thin your text appears. You can use keywords or numbers:

p {
  font-weight: normal;   /* default, same as 400 */
  font-weight: bold;     /* same as 700 */
  font-weight: lighter;  /* relative to parent */
  font-weight: bolder;   /* relative to parent */
}

h1 {
  font-weight: 300;  /* light */
  font-weight: 600;  /* semi-bold */
  font-weight: 900;  /* extra bold */
}

Numeric values range from 100 to 900 in increments of 100. Not all fonts support every weight — if you request 600 but the font only has 400 and 700, the browser picks the closest match.

Font Style: Italics and Oblique

The font-style property makes text slant, typically for emphasis or to denote titles:

em {
  font-style: italic;   /* uses font's italic design */
}

cite {
  font-style: oblique;  /* slants regular letters */
}

strong {
  font-style: normal;   /* removes italics */
}

Italic uses a specially designed slanted version of the font, while oblique simply tilts the regular letters. Most of the time, italic is what you want.

Key Takeaway: Use font-weight (normal, bold, or 100–900) to control text thickness and font-style (normal, italic, oblique) to add slant for emphasis.