πŸ”  CSS Tutorial: text-transform

πŸ“Œ Introduction

The text-transform property in CSS controls the capitalization of text. It allows you to convert text to uppercase, lowercase, or capitalize the first letter of each word β€” all without modifying the actual HTML content. This makes it a powerful tool for headings, buttons, UI labels, and consistent typography. ✨

🎯 Why Use text-transform?

  • To enforce consistent text formatting without changing content πŸ”‘
  • To style navigation menus, buttons, or labels elegantly 🎨
  • To automatically capitalize headings and titles ✍️
  • To convert case dynamically for multilingual UI 🌍

🧠 Available Values

1. none

No transformation is applied (default behavior).

2. uppercase πŸ” 

Converts all letters to uppercase.

3. lowercase πŸ”‘

Converts all letters to lowercase.

4. capitalize ✨

Capitalizes the first letter of each word.

5. full-width 🧱

Converts characters to their β€œfull-width” Unicode versions β€” often used in East Asian typography.

6. full-size-kana πŸ‡―πŸ‡΅

Converts Japanese katakana characters to full-width size. (Useful for Japanese UI/typography.)

✨ Syntax

Basic Syntax

selector {
  text-transform: none | uppercase | lowercase | capitalize | full-width | full-size-kana;
}

πŸ”₯ Examples

1. Uppercase Headings

Uppercase

h1 {
  text-transform: uppercase;
}

2. Capitalizing Titles

Capitalize

.title {
  text-transform: capitalize;
}

3. Lowercase Text

Lowercase

p.note {
  text-transform: lowercase;
}

4. Japanese Full-Size Kana

full-size-kana

.jp-text {
  text-transform: full-size-kana;
}

πŸ“Š Comparison Table

ValueEffect
noneNo transformation
uppercaseConverts all text to UPPERCASE
lowercaseConverts all text to lowercase
capitalizeMakes First Letter Of Each Word Uppercase
full-widthExpands characters to full-width Unicode
full-size-kanaConverts Japanese katakana to full-width

πŸ–ΌοΈ Visual Example

>>β€œTypography is not just about letters β€” it’s about how those letters make you feel.” ✨

πŸŽ‰ Conclusion

The text-transform property is a simple yet powerful CSS tool that ensures consistent, aesthetic, and accessible text formatting across your UI. From uppercase buttons to capitalized headings, it gives you full control without touching the original content. Master it and elevate your typography game! πŸš€