What is the text-transform property in CSS?

The text-transform property changes the capitalization of the text within an element. In CSS, the text-transform property allows us to convert any HTML object’s text to title case, upper case, or lower case.

svg viewer

Syntax

p {
text-transform: capitalize;
}

The text-transform property accepts the following values:

  • capitalize: Transforms the first character in each word to uppercase.
  • lowercase: Transforms all characters to lowercase.
  • none: Produces no capitalization effect at all.
  • uppercase: Transforms all characters to uppercase.

Code

The following example assigns different values of transform-text to different HTML elements:


Free Resources

Copyright ©2024 Educative, Inc. All rights reserved