The text-transform
property lets you easily change the case of text: uppercase, lowercase, capitalize each word, and more — without changing the actual HTML content.
🔹 What Does text-transform
Do?
It modifies the visual presentation of text by changing its capitalization — great for styling headings, labels, buttons, or formal content.
📘 Syntax
selector {
text-transform: none | uppercase | lowercase | capitalize | full-width | full-size-kana;
}
💡 Common Values
Value | What It Does | Example Output |
---|---|---|
none | No transformation | Text remains as typed |
uppercase | Converts all characters to uppercase | HELLO WORLD |
lowercase | Converts all characters to lowercase | hello world |
capitalize | Capitalizes the first letter of each word | Hello World |
full-width | Transforms Latin letters into full-width form | HELLO WORLD (mostly for CJK typesetting) |
full-size-kana | Transforms half-width katakana to full-size (Japanese) | カタカナ → カタカナ (for Japanese layout) |
✍️ Example: Uppercase Button Text
<button class="btn-uppercase">Submit</button>
.btn-uppercase {
text-transform: uppercase;
}
✅ Displays: SUBMIT
✍️ Example: Capitalized Headings
h2 {
text-transform: capitalize;
}
✅ Displays: The Quick Brown Fox
(even if the text was typed in all lowercase).
🖼️ Image Idea: Visual Demo of Each text-transform
Image Description:
Same sentence shown in six styles:
- Normal
uppercase
lowercase
capitalize
full-width
full-size-kana
🎯 Purpose: Show how each value changes the text’s appearance.
🧠 Best Use Cases
Use Case | Suggested Value |
---|---|
Navigation menu labels | uppercase |
Form placeholders or buttons | uppercase or capitalize |
Blog headings or titles | capitalize |
Localized web typography | full-width / full-size-kana (for CJK content) |
✅ Summary
Property | text-transform |
---|---|
Purpose | Changes text capitalization |
Common values | uppercase , lowercase , capitalize |
Special values | full-width , full-size-kana |
Works on | Any inline or block-level text elements |
⚠️ Notes & Tips
- It doesn’t affect HTML source text — only visual output.
- Not suitable for proper nouns or acronyms that require manual control.
- Combine with
letter-spacing
for stylized uppercase headers.
.upper-title {
text-transform: uppercase;
letter-spacing: 0.1em;
}
🔚 Final Thought
The text-transform
property is a fast, clean, and semantic way to style capitalization without modifying your content. It’s an essential tool in any web designer’s typography toolbox.