# Fill on Hover Text

> Outlined text that fills with solid color from left to right on hover.

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

## HTML

```html
<a class="text-fill" href="#">Portfolio</a>
```

## CSS

```css
.text-fill {
  color: transparent;
  font: 900 52px/1.1 system-ui, sans-serif;
  text-decoration: none;
  -webkit-text-stroke: 1.5px #fafafa;
  background: linear-gradient(#a3e635, #a3e635) left / 0% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-size 0.45s ease;
}

.text-fill:hover,
.text-fill:focus-visible {
  background-size: 100% 100%;
}
```

## Notes

- This CSS Fill on Hover Text is 15 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, gradient-clipped text and keyboard focus styles.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
