XML technologies / CSS / Advanced websites with CSS / CSS property reference / text-transform

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property text-transform describes the letter case in a text element. Text can be displayed entirely in uppercase or lowercase, or with initial capitals.

Inherited: yes

Values

The property text-transform accepts the following constants:

  • capitalize: The first letter of each word is capitalised.

  • lowercase: All letters are displayed in lowercase.

  • uppercase: All letters are displayed in uppercase.

  • none: The text is displayed as it appears in the source code.

Default value: none

Compatibility

CSS version: 1

Works in all CSS-capable browsers.

Example

The following style rule capitalises the initial letters of all words in headings:

h1, h2, h3, h4, h5, h6 {
 text-transform: capitalize;
}

  

 

 

 

back to top