# text-transform

> The `text-transform` CSS property controls the capitalization of text content within an element.

## How do I make text uppercase in CSS?

The property that controls the capitalization of text content within an element. It can convert text to uppercase, lowercase or capitalize the first letter of each word, providing a simple way to alter the appearance of text without changing the underlying content.

- Topic: Text Handling
- Type: property
- Browser support: Chrome 1+, Chrome Android 18+, Edge 12+, Firefox 1+, Firefox Android 4+, Safari 1+, Safari iOS 1+

## Example

Wrong:

```html
<button class="btn">
  SAVE CHANGES
</button>
```

Right:

```html
<button class="btn">Save changes</button>
<style>
  .btn {
    text-transform: uppercase;
  }
</style>
```

Keeping normal case in the markup lets design change in CSS and avoids screen readers reading caps oddly.

## Common mistakes

- `capitalize` was expected to make sentence case, but it capitalizes the first letter of every word.
- Some screen readers spell out words typed in all caps in the HTML.

## Key points

- Text is written in normal case in HTML and made uppercase with `text-transform`, not typed in capitals.
- Uppercase labels add a little `letter-spacing` to stay readable.

## Interview questions

### How do I make sentence case with CSS?

There is no sentence-case value. Lowercase the text and use `::first-letter` with `text-transform: uppercase` on the element.

### Does text-transform change the actual text?

No. It only changes how text is displayed; the DOM text stays the same.

## Related cards

- [letter-spacing](https://wonderium.dev/css/letter-spacing.md)
- [::first-letter](https://wonderium.dev/css/first-letter.md)
- [font-variant-caps](https://wonderium.dev/css/font-variant-caps.md)
- [Screen Readers](https://wonderium.dev/a11y/screen-readers.md)

---

- Level: [CSS](https://wonderium.dev/css.md)
- HTML version: https://wonderium.dev/css/text-transform
- Last updated: 2026-11-25
