Text Transformation
The text-transform property is used to change the capitalization of text.
It can convert text to uppercase, lowercase, capitalize each word, or display the text normally.
How Text Transformation Works
Example 1: Uppercase
The uppercase value converts all letters to capital letters.
CSS Code
p {
text-transform: uppercase;
}
Output
welcome to css
Example 2: Lowercase
The lowercase value converts all letters to lowercase.
CSS Code
p {
text-transform: lowercase;
}
Output
WELCOME TO CSS
Example 3: Capitalize
The capitalize value makes the first letter of each word uppercase.
CSS Code
p {
text-transform: capitalize;
}
Output
learn css step by step
Example 4: None
The none value keeps the original capitalization of the text.
CSS Code
p {
text-transform: none;
}
Output
CSS Text Example
Common Text Transform Values
| Value | Effect |
|---|---|
uppercase
|
Converts all letters to uppercase |
lowercase
|
Converts all letters to lowercase |
capitalize
|
Capitalizes the first letter of each word |
none
|
Keeps the original text capitalization |
Simple Explanation
uppercase → Converts all letters to capital letters.
lowercase → Converts all letters to small letters.
capitalize → Makes the first letter of each word uppercase.
none → Keeps the original capitalization.
Summary
The text-transform property controls
the capitalization of text. Common values are
uppercase, lowercase,
capitalize, and none.