English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules

Comprehensive List of CSS Properties

CSS text-Usage and examples of transform attribute

text-The transform CSS attribute controls the case of text.

The following table provides usage instructions and version history of this attribute, as well as the usage syntax of this attribute in JavaScript scripts.

Default value:none
Applicable to:All elements
Inheritance:Yes
Animatable:No.Please see Animation properties.
Version:CSS 1,2,3
JavaScript syntax:object.style.textTransform="lowercase"

text-transform usage syntax

The syntax of this attribute is as follows:

text-transform: capitalize | lowercase | none | uppercase | initial | inherit

The following examples demonstrate how to use text-transform attribute.

  p {
   text-transform: capitalize;
  }
Test see‹/›

Attribute value

The following table describes the values of this attribute.

ValueDescription
capitalizeConvert the first character of each word to uppercase; other characters are not affected.
lowercaseConvert all characters of each word to lowercase.
uppercaseConvert all characters of each word to uppercase.
noneNo uppercase effect. Text is presented as it is. This is the default value.
initialSet this attribute to its default value.
inheritIf specified, the associated elements adopt the text of their parent element.-Values of the transform attribute.

Browser compatibility

text-Browser compatibility of the transform attribute, the numbers in the following table represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 3+

  • Apple Safari 1+

  • Opera 3.5+

Further reading

Please refer to the following tutorials:CSS text,CSS font.

Text-related attributes:letter-spacing,text-align,text-decoration,text-indent,text-overflow,text-shadow,white-space,word-spacing.