HTML CSS examples for CSS Property:text-transform
The text-transform CSS property transforms the text case.
The following table summarizes the text-transform Property.
Item | Value |
---|---|
Default value: | none |
Applies to: | All elements |
Inherited: | Yes |
Animatable: | No. |
The syntax of the property is as follows:
text-transform: capitalize | lowercase | none | uppercase | initial | inherit
The following table describes the values of this property.
Value | Description |
---|---|
capitalize | Turn the first character of each word in uppercase. |
lowercase | Turn all characters into lowercase. |
uppercase | Turn all characters into uppercase. |
none | Default value. The text renders as it is. |
initial | Sets this property to its default value. |
inherit | take the value of its parent element text-transform property. |
The example below shows the text-transform property.
<!DOCTYPE html> <html lang="en"> <head> <title>Example of CSS text-transform property</title> <style type="text/css"> p.low {<!-- ww w . j a v a 2 s. co m--> text-transform: lowercase; } p.cap { text-transform: capitalize; } p.up { text-transform: uppercase; } </style> </head> <body> <h1>Text-transform Effect</h1> <p>This is a normal paragraph.</p> <p class="low">TEST.</p> <p class="cap">test.</p> <p class="up">test.</p> </body> </html>