• Home
  • About
  • Contact
  • Advertise

Devlounge

Design, Develop, and Grow

Free Start Page
  • Home
  • Code
  • Design
  • Design Focus
  • Interviews
  • Publishing
  • Strategy
  • Webapps
  • Extras
You are here: Home / Design / Transform your text with text-transform

Transform your text with text-transform

May 27, 2009 by Lorraine

Text-transform is an incredibly useful CSS property, yet also one of the most underused. Here are its possible values (with examples):

none : Default. Defines normal text, with lower case letters and capital letters
e.g. The quick brown fox jumps over the lazy dog.

capitalize : Each word in a text starts with a capital letter
e.g. The quick brown fox jumps over the lazy dog.

uppercase : Defines only capital letters
e.g. The quick brown fox jumps over the lazy dog.

lowercase : Defines no capital letters, only lower case letters
e.g. The quick brown fox jumps over the lazy dog.

How useful is text-transform? Well, let’s say you want all of your h3 headers to be in all-caps on your blog. You could type it in with all-caps in your blog title field, but there are a few problems there:

  • You would have to do this every time you wrote a blog post.
  • Should you decide, in the future, that you don’t want all h3 headers in uppercase- you would have to rewrite everything.
  • For blogs or sites with multiple authors, you would have to make sure each author knows to type in uppercase for a certain field.
  • The search engines that index you will show your titles IN ALL CAPS, which looks kinda spammy.

So here’s what you do. You write your blog titles normally, and in your stylesheet you add:

h3 {text-transform:uppercase}

This way, your titles are in uppercase. You can transform them anytime by changing uppercase to capitalize or lowercase. You don’t need to tell other authors which things to capitalize or type in all uppercase. And the search engines will publish them normally in their results. Everybody wins.

And what if you want your blog title h3s to be uppercase, but not the h3s in your sidebar? That’s where none comes in. Add something like this to your stylesheet:

#sidebar h3 {text-transform:none}

and voila! All h3 titles in your sidebar revert back to normal casing.

Do you use text-transform? What are your favorite underused CSS properties?

Filed Under: Design Tagged With: css, CSS properties, CSS text, text-transform


Code & Tutorials

Make your site more sociable with OpenGraph markup

How to add Pinterest’s “Pin It” button on your WordPress and Genesis Framework site

How to add Pinterest’s “Pin It” button on your WordPress and Genesis Framework site

CSS Layout Techniques

CSS Layout Techniques

17 Miscellaneous WordPress Plug-ins for 2011

17 Miscellaneous WordPress Plug-ins for 2011

Media Queries and the Thoughts Behind It

Media Queries and the Thoughts Behind It

About Devlounge

Want to read more about Devlounge, or maybe you want to contact us, or even advertise? Oh, and don't forget to subscribe to updates!

The Best of Devlounge

Cool Tools for Creative Blog Content

Cool Tools for Creative Blog Content

Search

Devlounge is published by BusinessLogs © 2006 - 2016 · Maintained by Performancing, Social Media Management and WordPress Consulting