Transform text in different <div> elements:
div.a {
text-transform: uppercase;
}
div.b {
text-transform: lowercase;
}
div.c {
text-transform: capitalize;
}
Try it Yourself »
The text-transform
property controls the capitalization of text.
Default value: | none |
---|---|
Inherited: | yes |
Version: | CSS1 |
JavaScript syntax: | object.style.textTransform="uppercase" Try it |
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
text-transform | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
text-transform: none|capitalize|uppercase|lowercase|initial|inherit;
Value | Description | Demo |
---|---|---|
none | No capitalization. The text renders as it is. This is default | Demo ❯ |
capitalize | Transforms the first character of each word to uppercase | Demo ❯ |
uppercase | Transforms all characters to uppercase | Demo ❯ |
lowercase | Transforms all characters to lowercase | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS tutorial: CSS Text Transformation
HTML DOM reference: textTransform property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!