How to change the cases of text in paragraph using CSS?

The approach of this article is to ow to change cases of text in a paragraph by using the CSS  text-transform Property. It is s used to control the capitalization of the text. It mainly changes the text into upper case and lowercase format.

Syntax: 

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

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html> 
  
<head> 
    <style> 
        h1
            color: green
        
          
        p.gfg { 
            text-transform: capitalize
        
        p.GFG 
        {
            text-transform:uppercase
        }
        p.sudo 
        {
            text-transform:lowercase;
        }
          
    </style> 
</head> 
  
<body> 
    <center
        <h1>GeeksForGeeks</h1>
        <h2
        How to change cases of text 
in paragraph using CSS?
</h2>
          
        <p class="gfg">capitalize</p> 
        <p class="sudo"
        lower case letter
        </p>  
        <p class="GFG"
        uppercase letter</p>
</body> 
  
</html>

chevron_right


Output:

Supported Browsers are listed below:

  • Google Chrome 1.0
  • Internet Explorer 4.0
  • Firefox 1.0
  • Opera 1.0
  • Safari 3.5



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.