CSS text-transform Property

CSS text-transform property sets the capitalization of the text in HTML Element(s).

The syntax to specify a value for text-transform property is

text-transform: value;

The following table gives the possible values that could be given to text-transform property.

ValueDescriptionExamples
noneNo capitalization.text-transform: none;
capitalizeConverts the first character of each word to uppercase.text-transform: capitalize;
uppercaseConverts all character in text to uppercase.text-transform: uppercase;
lowercaseConverts all character in text to lowercase.text-transform: lowercase;
initialSets text-transform to default value.text-transform: initial;
inheritInherits text-transform value from its parent element.text-transform: inherit;

Examples

In the following examples, we transform the text in HTML Element(s), in terms of case, using text-transform property.

ADVERTISEMENT

text-transform: capitalize;

In the following example, we set the first character of each word to uppercase, using text-transform property.

index.html

text-transform: uppercase;

In the following example, we set all characters to uppercase, using text-transform property.

index.html

text-transform: lowercase;

In the following example, we set all characters to lowercase, using text-transform property.

index.html

text-transform: none;

In the following example, we set text-transform property with none for the paragraph HTML Element.

index.html

Conclusion

In this CSS Tutorial, we learned about text-transform property, and how to use this property for HTML Elements, with examples.