CSS - text-transform


Description:

The text-transform property changes the capitalization of text within an element, or else directs the user agent to leave the capitalization "as is."

Possible Values:

  • capitalize: The first letter of each word in the element's text should be capitalized.
  • uppercase: All of the characters in the element's text should be uppercase (capital letters).
  • lowercase: All of the characters in the element's text should be lowercase.
  • none: The capitalization of the element's text should not be altered.

Applies to:

All the HTML elements.

DOM Syntax:

object.style.textTransform="uppercase";

Example:

Following is the example which demonstrates how to set the cases for a text using text-transform property.

<p style="text-transform:capitalize;">
This will be capitalized
</p>
<p style="text-transform:uppercase;">
This will be in uppercase
</p>
<p style="text-transform:lowercase;">
This will be in lowercase
</p>
     

This will produce following result:

This will be capitalized

This will be in uppercase

This will be in lowercase





Spacer Bottom Left Corner ImageBottom Right Corner Image
Valid XHTML 1.0 Strict  Valid CSS! Check the accessibility of this site according to U.S. Section 508