CSS text-transform property
CSS text-transform property
Description
The text-transform property is used to change the case of text within an element, or to instruct the user agent to preserve the case of the original text.
Possible values
- capitalize – The first letter of each word in the element’s text should be capitalized.
-
uppercase – All characters in the element’s text should be uppercase.
-
lowercase – All characters in the element’s text should be lowercase.
-
none – The capitalization of the element’s text should not be altered.
Applies to
All HTML elements.
DOM Syntax
object.style.textTransform = "uppercase";
Example
The following is an example that demonstrates how to use the text-transform property to set the case of text.
<html>
<head>
</head>
<body>
<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>
</body>
</html>
This will produce the following resultsā