Andromeda
Note

CSS Typography

Definition

CSS Typography refers to the set of CSS properties used to control the layout and appearance of text on a web page, such as font size, weight, line height, and text alignment.

Why It Matters

Typography is the primary medium of web communication. Proper styling ensures readability, user accessibility, and brand consistency.

Core Concepts

  • font-family: Declares font priority stacks ending in generic fallbacks (serif, sans-serif, monospace).
  • font-size: Sets text height using absolute (px) or relative (em, rem, %) units.
  • line-height: Controls vertical line spacing, which is critical for reading comfort (1.4–1.6 is recommended).
  • font Shorthand: Combines weight, style, size/line-height, and family in a single declaration.
h1 {
  font-family: 'Georgia', serif;
  font-size: 2.5rem;
  line-height: 1.4;
  font-weight: bold;
  text-align: center;
}

Connected Concepts