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.
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.The following example assigns different values of transform-text
to different HTML elements:
Free Resources