Skip to main content

text-transform (CSS property)

By Adam Roberts



Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95


text-transform: { capitalize | lowercase | none | uppercase | inherit } ;


This property controls if and how an element’s text content is capitalized.


These style rules make
h1 headings use only uppercase letters, while the first
letter of each word in h2 headings will be

h1 {
  text-transform: uppercase;
h2 {
  text-transform: capitalize;


  • capitalize
  • Transforms the first character in each word to uppercase; all other characters remain unaffected—they’re not transformed to lowercase, but will appear as written in the document
  • lowercase
  • Transforms all characters to lowercase
  • none
  • Produces no capitalization effect at all

  • uppercase
  • Transforms all characters to uppercase

Related Articles

Adam is SitePoint's head of newsletters, who mainly writes Versioning, a daily newsletter covering everything new and interesting in the world of web development. He has a beard and will talk to you about beer and Star Wars, if you let him.

New books out now!

Learn the basics of programming with the web's most popular language - JavaScript

A practical guide to leading radical innovation and growth.

Integromat Tower Ad