Wednesday, February 1, 2012

Convert Text into Upper case, Lower case OR Capitalize using CSS

Find solution of following Queries:
Ques: How to Capitalize first character of each word in a sentence?
Ques: How to convert a String/Text into lower case?
Ques: How to convert a String/Text into upper case?

                CSS text-transform Property

Value  Description
none : No capitalization. The text renders as it is. This is default
capitalize : Transforms the first character of each word to uppercase
uppercase : Transforms all characters to uppercase
lowercase : Transforms all characters to lowercase
inherit : Specifies that the value of the text-transform property should be  inherited from the parent element

                                  Example
<html>
   <head>
     <style type="text/css">
         .uppercase {text-transform:uppercase;}
         .lowercase {text-transform:lowercase;}
         .capitalize {text-transform:capitalize;}
     </style>
   </head>
   <body>
       <span class="uppercase">This is some text.</span >
       <p class="lowercase">This is some text.</p>
       <span class="capitalize">This is some text.</span >
    </body>
</html>

              OUTPUT
THIS IS SOME TEXT.
this is some text.
This Is Some Text.


0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Code Imagine