Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape

CSS Text Transformation

CSS Text Transformation

CSS Text Transformation – CSS Tutorial | Shree Narayan Computers & Education Center
CSS COURSE • LESSON

CSS Text Transformation

Learn how to change the capitalization of text using the CSS text-transform property. Explore uppercase, lowercase, capitalize and none with practical examples and live demonstrations.

📘 What is CSS Text Transformation?

The CSS text-transform property controls the capitalization of text without changing the original text written in HTML.

It is useful when you want headings, buttons, navigation links or labels to appear in a specific capitalization style.

In simple words: text-transform changes how text is displayed on the screen, while the original HTML text remains unchanged.

🧩 CSS Text Transform Syntax

selector {
    text-transform: value;
}

🔑 Text Transform Values

ValuePurposeExample Result
noneUses the normal text capitalization.Hello world
uppercaseConverts all letters to uppercase.HELLO WORLD
lowercaseConverts all letters to lowercase.hello world
capitalizeCapitalizes the first letter of each word.Hello World

⚪ Example 1: text-transform: none

The none value displays text normally without applying a transformation.

.text {
    text-transform: none;
}
Hello World From SNCEC

🔠 Example 2: Uppercase

Use uppercase to display all letters in capital form.

.heading {
    text-transform: uppercase;
}
welcome to shree narayan computers

🔡 Example 3: Lowercase

Use lowercase to display all letters in lowercase.

WELCOME TO SHREE NARAYAN COMPUTERS

🔤 Example 4: Capitalize

The capitalize value changes the first letter of each word to uppercase.

.title {
    text-transform: capitalize;
}
learn computer skills with practical training

▶️ Live Comparison

The same HTML text can be displayed in different forms by changing only the CSS property.

Original: welcome to sncec
Uppercase: welcome to sncec
LOWERCASE: WELCOME TO SNCEC
capitalize: welcome to sncec

💻 Practical Example: Navigation Menu

Text transformation is commonly used for navigation menus and buttons.

.menu a {
    text-transform: uppercase;
}

.menu a:hover {
    text-transform: uppercase;
}
This allows you to write normal text in HTML while displaying navigation labels consistently in uppercase.

🔘 Practical Example: Button Text

.button {
    text-transform: uppercase;
    font-weight: bold;
}

🎯 Text Transformation for Headings

You can use text transformation to maintain a consistent heading style throughout a website.

h2 {
    text-transform: capitalize;
}

💡 Important Note

CSS text-transform changes the visual presentation of text. It does not rewrite the actual text stored in your HTML.

Example:

HTML: <h1>welcome to sncec</h1>

CSS: text-transform: uppercase;

Display: WELCOME TO SNCEC

💡 Practical Uses

🧭 Navigation

Display menu links consistently in uppercase.

🔘 Buttons

Create consistent button labels.

📢 Headings

Maintain a consistent typography style.

🏷️ Labels

Standardize labels and small interface elements.

⚠️ Common Mistakes

  • Confusing capitalize with uppercase.
  • Using uppercase text everywhere, which can reduce readability.
  • Forgetting that text-transform changes display, not the original HTML text.
  • Using inconsistent transformations across navigation elements.
See also  HTML Iframe
Design Tip: Use uppercase mainly for short labels, navigation items, buttons and headings. Avoid large blocks of uppercase text.

📝 Practice Exercises

Try these exercises in your HTML Runner:

  1. Create a heading and convert it to uppercase.
  2. Convert uppercase text to lowercase.
  3. Use capitalize on a paragraph.
  4. Create a navigation menu using uppercase text.
  5. Create an “Enroll Now” button using uppercase text.
  6. Compare none, uppercase, lowercase and capitalize.

📚 Quick Reference

CSSPurposeExample
text-transformControls text capitalization.uppercase
noneNormal text.hello world
uppercaseAll letters become uppercase.HELLO WORLD
lowercaseAll letters become lowercase.hello world
capitalizeCapitalizes each word.Hello World

🎓 Key Points to Remember

  • text-transform controls text capitalization.
  • uppercase converts letters to uppercase.
  • lowercase converts letters to lowercase.
  • capitalize capitalizes the first letter of each word.
  • none keeps the normal text presentation.
  • CSS transformation changes visual presentation without changing the original HTML text.

CSS Float

  • 18/08/2026

HTML Images

  • 17/08/2026

CSS Flex Wrap

  • 19/08/2026

Leave a Reply

Your email address will not be published. Required fields are marked *