# Gradient Outline Text

> Hollow headline text with a gradient outline, made from a transparent stroke over a clipped gradient.

- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: stroke, hollow, text-stroke, background-clip, heading
- Live preview: https://copy-css.com/snippets/gradient-outline-text
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<h2 class="text-grad-stroke">HOLLOW</h2>
```

## CSS

```css
/* --fill must match the background behind the text */
.text-grad-stroke {
  --fill: #ffffff;
  margin: 0;
  font: 900 48px/1 system-ui, sans-serif;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, #f97316, #db2777, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: var(--fill);
  -webkit-text-stroke: 4px transparent;
}
```

## Notes

- This CSS Gradient Outline Text is 12 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients, gradient-clipped text and custom properties.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- Customize with: `--fill`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
