Sobes.tech
Junior

Which CSS property is used to convert text to uppercase or lowercase?

sobes.tech AI

Answer from AI

text-transform.

This property controls the case of text in elements:

  • none: No change.
  • capitalize: The first letter of each word becomes uppercase.
  • uppercase: All text becomes uppercase.
  • lowercase: All text becomes lowercase.
  • full-width: Converts all characters to full-width equivalents (used in Asian languages).

Example usage:

/* All text will be uppercase */
p {
  text-transform: uppercase;
}

/* The first letter of each word will be uppercase */
h1 {
  text-transform: capitalize;
}