CSS Text Properties

CSS text properties control the appearance and formatting of text content, including alignment, decoration, transformation, spacing, and more.

Text Alignment and Direction

The text-align property controls horizontal alignment: left, right, center, or justify.

text-align only works on block-level elements.

The direction property sets text direction: ltr (left-to-right) or rtl (right-to-left).

justify spaces text to align both left and right edges.

/* Text alignment */
.left {
  text-align: left;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.justified {
  text-align: justify;
}

/* Text direction */
.rtl {
  direction: rtl;
}