# text-fit (fit-to-width headlines)

Status: Chrome 150 only (June 2026). Not Baseline.  
Source: https://developer.chrome.com/release-notes/150  
Page: https://designforai.dev/css/text-fit

Scales a heading's font size so the line exactly fills its container, the CSS answer to "fit text" JS plugins.

## HTML

```html
<h1 class="fx-056">Fits the width</h1>
```

## CSS

```css
.fx-056 {
  font-size: clamp(2rem,8vw,6rem);
  text-fit: fit-width;
  white-space: nowrap;
  font-family: system-ui;
  margin: 0;
  max-width: 100%
}
```

Fallback: Keep the `clamp()` font-size as the fallback; other browsers use it.

## Prompt

For poster-style headings that must span the full width, add `text-fit: fit-width` with `white-space: nowrap` on top of a `clamp()` font-size fallback. Chrome 150+ only in 2026-09; do not add a fit-text JS library.
