Property Description
The text-transform property sets the capitalization of text.
This property has the following syntax:
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
Property Values
| Value | Description |
|---|---|
| none | (default) No transformation. The text renders as it is |
| capitalize | Transforms the first character of each word to uppercase |
| uppercase | Transforms all characters to uppercase |
| lowercase | Transforms all characters to lowercase |
| initial | Specifies that the value of the property should be set to the default value |
| inherit | Specifies that the value of the property should be inherited from the parent element |
Examples
This example shows how to transform text in different elements.
h1 {
text-transform:uppercase
}
h2 {
text-transform:capitalize
}
p {
text-transform:lowercase
}
This example shows the results of setting the various text-transform values:
text-transform:none
text-transform:capitalize
text-transform:uppercase
text-transform:lowercase
text-transform:capitalize
text-transform:uppercase
text-transform:lowercase
Browser Support
| Chrome | Firefox | IE | Safari | Opera |
|---|---|---|---|---|
| 1.0 | 1.0 | 4.0 | 1.0 | 7.0 |
Miscellaneous Information
| Inherited: | Yes |
|---|---|
| Defined In: | CSS1 |
| Default Value: | none |
