Web Development Tutorials.com

How to set text to all upper-case, all lower-case letters and to capitalize the first letter of every word with CSS


Click Here for CoffeeCup Website Design Software   GoDaddy.com Hosting & Servers

The below HTML and CSS code example shows you how to set text to all upper-case letters, all lower-case letter and to capitalize the first letter of every word with CSS.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>this is the title of the web page</title>

<style type="text/css">

</style>

</head>
<body>

<p style="text-transform: uppercase;">
All of the letters in this paragraph will be set to all capital letters. some text SOME TEXT.
</p>
<p style="text-transform: lowercase;">
All of the letters in this paragraph will be lower-case. some text SOME TEXT.
</p>
<p style="text-transform: capitalize;">
Every word in this paragraph will be capitalized.
</p>

</body>
</html>

The above HTML and CSS code makes the paragraphs below.

All of the letters in this paragraph will be set to all upper-case letters. some text SOME TEXT.

All of the letters in this paragraph will be lower-case. some text SOME TEXT.

Every word in this paragraph will be capitalized.

Use the text editor below to practice using the text-transform attribute.