How gradient text works
CSS can’t fill text with a gradient directly, so the trick is to paint a gradient as the element’s background, then clip that background to the shape of the letters with background-clip: text and make the text colour transparent so the background shows through. The -webkit- prefixed lines are still needed for Safari and older Chromium. A solid color fallback is included first for very old browsers.
Design tips
- Use bold, large type — thin letters show too little of the gradient.
- Neighbouring hues (purple → pink → orange) look smoother than opposites.
- Check that the lightest part still contrasts with the background.
- The animated version moves an oversized background; keep it for one hero line, not paragraphs.
Want the gradient as a background instead? Use the CSS Gradient Generator.
Frequently asked questions
Is gradient text accessible?
Screen readers read it normally. Just keep enough contrast with the background.
Why does my text disappear?
background-clip: text needs the -webkit- prefix in Safari; without it, the transparent text shows nothing.
Can I select and copy gradient text?
Yes — it is still real text.
Last updated 2026-11-21 · Built by Vinayak Agarwal · Part of CSS & Design (37 tools)