The CSS reference

"text-transform" - css property (v. css 1)

  • To Control the capitalization of text
  • The actual transformation in each case is human language dependent.
  • Initial value: none
  • The property is inherited
  • HTML usage: all elements
  • Browsers that support the text-transform - property :
    Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari

Possible text-transform values:

value Comments CSS
capitalize Puts the first character of each word in uppercase; other characters are unaffected. 1
uppercase Puts all characters of each word in uppercase. 1
lowercase Puts all characters of each word in lowercase. 1
none No capitalization effects. 1
inherit Will inherit the value from parent specification. This property value is new with CSS 2. 2

Property "text-transform" example:

<!DOCTYPE HTML >
<html  >
  <head>
    <title>Test</title>
    <style type="text/css">
      div {border: blue 1px solid; color:black;
           padding: 0.2em 0.2em 0.2em 0.4em; width: 400px;}
      .uppercase { text-transform: uppercase;  }
      .lowercase { text-transform: lowercase;  }
      .capitalize { text-transform: capitalize; }
    </style>
  </head>
  <body>
    <br>uppercase:<br>
    <div class="uppercase">the actual transformation in
      each case is human language dependent.
    </div>
    <br>lowercase:<br>
    <div class="lowercase">the actual transformation in
      each case is human language dependent.
    </div>
    <br>capitalize:<br>
    <div class="capitalize">the actual transformation in
      each case is human language dependent.
    </div>
   </body>
</html>

Javascript access:

// To SET values ([o] is the target object)
[o].style.textDecoration="text-decoration value"
// To GET values you must first get the computed style object
// To get that object in IE or Opera:
var cStyle=[o].currentStyle;
// To get that object in Firefox, Chrome or Safari (w3c-type):
var cStyle=window.getComputedStyle([o],null)
// To GET the property value:;
var value=cStyle.textDecoration;
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.