Trusted answers to developer questions

What is the text-transform property in CSS?

Get the Learn to Code Starter Pack

Break into tech with the logic & computer science skills you’d learn in a bootcamp or university — at a fraction of the cost. Educative's hand-on curriculum is perfect for new learners hoping to launch a career.

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:


RELATED TAGS

css
text
transform
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?