In 2024, we can do this cross-browser, with no vendor prefixes!

p {
    background-image: linear-gradient(red, blue);
    color: transparent;
    background-clip: text;
}

Some things to note:

  • A lot of the old examples use -webkit-text-fill-color rather than color. The two are actually functionally identicial[1] (and both support transparent!), -webkit-text-fill-color just takes precidence. The reason this was used in old examples was because it provided a graceful fallback for non-webkit browsers --- any non-webkit browser that ignored the gradient or clip instructions would also ignore the -webkit-text-fill-color instruction, meaning that you wouldn't be left with transparent text on unsupported browsers. I guess this is a problem with this cross browser implementation, in that that we can't do a fallback like this, but it'll really only be a problem for really old browsers like IE11.
  • background-clip is now standards tracked and implemented in all browsers. However, it took Chrome a long time to support the text clip option on the non-vendor prefixed one, with this only coming in Chrome 120, released mid 2023! As such, using both background-clip: text (for e.g. Firefox) and -webkit-background-clip: text was the best solution until just very recently, and you might still need both unless you're only targeting ultra-modern browser versions.
Answer from toastrackengima on Stack Overflow
🌐
CSS Gradient
cssgradient.io β€Ί blog β€Ί css-gradient-text
CSS Gradient Text – CSS Gradient
Add eye-catching gradient effects to your website text using pure CSS. Learn how to create vibrant, image-free text gradients with step-by-step syntax examples and tips.
🌐
Medium
medium.com β€Ί @mattkenefick β€Ί css-gradient-text-reveal-739e7fe36221
CSS Gradient Text Reveal with masks | by Matt Kenefick | Medium
August 20, 2021 - CSS Gradient Text Reveal with masks What are we making? A gradient reveal over a complex background using only CSS. View an example: https://jsfiddle.net/ptsc2xba/ The demo is intentionally slow to …
Discussions

css text gradient - Stack Overflow
I've had a little look around and can't find anything about this. If I have a paragraph of text, is there a way, maybe with CSS3 to gradually change the colour of the text as it goes down to the pa... More on stackoverflow.com
🌐 stackoverflow.com
Gradient not working when there's a background color
You need to use -webkit- before that gradient and the background-clip. You also need to use -webkit-text-fill-color, instead of color. CSS: #maintitle { background: -webkit-linear-gradient(90deg, red, blue); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; } Codepen: https://codepen.io/andybeckmann/pen/NWXWRmq?editors=1100 Resource: https://cssgradient.io/blog/css-gradient-text/ More on reddit.com
🌐 r/css
6
4
November 21, 2021
Buttons with gradient border and cut corners.

You'd be able to do something like this with an SVG

More on reddit.com
🌐 r/css
12
3
January 14, 2017
Pure CSS3 text color gradient - Is it possible?

Short answer: no. Use pngs, or realize that your design will never look the same in all browsers.

Build a solid foundation and use things like text gradients as frosting for people who have browsers that support these kinds of pretty add ons.

More on reddit.com
🌐 r/web_design
2
0
August 31, 2007
🌐
Frontend Hack
frontendhack.com β€Ί home β€Ί blogs β€Ί complete guide to gradient text effects & generator
Complete Guide to Gradient Text Effects & Generator
January 24, 2026 - Learn how to create stunning gradient ... the crowd. CSS gradient text works by applying gradient backgrounds to text and then making the text itself transparent so the gradient shows through....
🌐
CSS Gradient Generator
css-gradient.com β€Ί text-gradients
Text Gradients | CSS Gradient
Probably less known than the linear gradient and the radial gradient, is the text gradient. It's the same background idea as the linear gradient, only that in this case you apply the gradient to a text instead of filling a background.
Top answer
1 of 7
54

In 2024, we can do this cross-browser, with no vendor prefixes!

p {
    background-image: linear-gradient(red, blue);
    color: transparent;
    background-clip: text;
}

Some things to note:

  • A lot of the old examples use -webkit-text-fill-color rather than color. The two are actually functionally identicial[1] (and both support transparent!), -webkit-text-fill-color just takes precidence. The reason this was used in old examples was because it provided a graceful fallback for non-webkit browsers --- any non-webkit browser that ignored the gradient or clip instructions would also ignore the -webkit-text-fill-color instruction, meaning that you wouldn't be left with transparent text on unsupported browsers. I guess this is a problem with this cross browser implementation, in that that we can't do a fallback like this, but it'll really only be a problem for really old browsers like IE11.
  • background-clip is now standards tracked and implemented in all browsers. However, it took Chrome a long time to support the text clip option on the non-vendor prefixed one, with this only coming in Chrome 120, released mid 2023! As such, using both background-clip: text (for e.g. Firefox) and -webkit-background-clip: text was the best solution until just very recently, and you might still need both unless you're only targeting ultra-modern browser versions.
2 of 7
21

You can do it using CSS but it will only work in webkit browsers (Chrome and Safari):

p {
    background: linear-gradient(red, blue);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}
<p>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah</p>

🌐
Fossheim
fossheim.io β€Ί writing β€Ί posts β€Ί css-text-gradient
How to add a gradient overlay to text with CSS by Sarah L. Fossheim
We can do this by adding a background-color property to the text as well. .gradient-text { background-color: #f3ec78; background-image: linear-gradient(45deg, #f3ec78, #af4261); background-size: 100%; -webkit-background-clip: text; -moz-background-clip: text; -webkit-text-fill-color: transparent; -moz-text-fill-color: transparent; }
Find elsewhere
🌐
Coolors
coolors.co β€Ί gradient-maker
Create a Gradient - Coolors
Create and export beautiful gradients. ColorRemove Β· Position Β· Rotation Β· Type Β· Random Β· Copy CSS Β· Browse all gradients Β· Color code Β· Email not received? Send again Do you need help? Contact us Β· Export Palette Β· URL Share PDF Image CSS ASE SVG Code Tailwind Embed X Pinterest Β·
🌐
DEV Community
dev.to β€Ί learnwithparam β€Ί gradient-text-style-using-css-11ka
Gradient text style using CSS - DEV Community
April 14, 2019 - .gradient-text { // set the background color background: linear-gradient(to right, #ff8a00 0%, #da1b60 100%); // background color masked along the text and clip away the rest -webkit-background-clip: text; // make fill color to transparent so that masked background color will be shown -webkit-text-fill-color: transparent; }
🌐
Stack Overflow
mariokandut.com β€Ί how to create gradient text with css
How to create gradient text with CSS
March 11, 2021 - .gradient-text { background-color: ... Voila, that's it. ... With the CSS function linear-gradient() it's easy to apply a linear gradient to a div, and with a background-clip you can adjust it for texts....
🌐
30 Seconds of Code
30secondsofcode.org β€Ί home β€Ί css β€Ί visual β€Ί gradient text
CSS - Gradient text - 30 seconds of code
September 10, 2024 - You use the linear-gradient() function to define the gradient colors and direction. Then, you have to apply it to the text using the -webkit-text-fill-color property with a value of transparent.
🌐
Colorffy
colorffy.com β€Ί text-gradient-generator
CSS Text Gradient Generator | Colorffy
Simply choose your desired colors, set the gradient direction (linear, radial, or conic), and watch your text come to life in the real-time preview. Once you've crafted the perfect effect, our tool instantly generates the clean, cross-browser compatible CSS code.
🌐
CSS Gradient
cssgradient.io
CSS Gradient – Generator, Maker, and Background
As a free CSS gradient generator tool, this website lets you create a colorful gradient background for your website, blog, or social media profile.
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί css β€Ί how-to-add-a-gradient-overlay-to-text-with-css
How to Add a Gradient Overlay to Text with CSS? - GeeksforGeeks
March 26, 2024 - The background-clip property with the value text allows you to clip the background to the text, making it possible to apply a gradient overlay directly to the text.
🌐
W3Schools
w3schools.com β€Ί css β€Ί css3_gradients.asp
CSS Gradients
The CSS gradient functions let you display smooth transitions between two or more colors within an element.
🌐
Webtips
webtips.dev β€Ί webtips β€Ί css β€Ί how-to-create-gradient-texts-in-css
How to Create Gradient Texts in CSS - Webtips
August 17, 2025 - /* Create text gradients with the following: */ .gradient { background: -webkit-gradient(linear, left top, left bottom, from(#FCA101), to(#F03823) ); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } /* Will produce the following: */ gradient-text.css
🌐
Delasign
delasign.com β€Ί blog β€Ί reactjs-outline-gradient-text-css
How to create text that has a Stroke and a Gradient fill in CSS
A gradient html text element with the position set to absolute and the z-index set to 2, so it is above the stroke. The code sets the top and left css properties of the html text elements that use an absolute position 0 so that they perfectly align above the original html text element (i.e.
🌐
Prismic
prismic.io β€Ί blog β€Ί css-hover-effects
CSS Hover Effects: 40 Engaging Animations To Try
December 11, 2024 - This animation creates an "explosive" effect when the element is hovered over. It works with the ::before and ::after pseudo-elements, which produces the radial gradient effect and scale up and rotate on hover. This animation creates a unique hover effect where underlines appear above and below the text when the user hovers over it.
🌐
CodyHouse
codyhouse.co β€Ί nuggets β€Ί text-gradients
Text Gradients in CSS | CodyHouse
November 24, 2020 - .text-gradient { /* πŸ‘‡ show a solid color in older browsers (e.g., IE11) */ color: darkblue; } /* πŸ‘‡ show the text gradient in modern browsers */ @supports (--css: variables) { .text-gradient { background: linear-gradient(to right, darkblue, darkorchid); color: transparent; -webkit-background-clip: text; background-clip: text; } }
🌐
DEV Community
dev.to β€Ί fossheim β€Ί how-to-add-a-gradient-overlay-to-text-with-css-2f99
How to add a gradient overlay to text with CSS - DEV Community
January 19, 2020 - We can do this by adding a background-color property to the text as well. .gradient-text { background-color: #f3ec78; background-image: linear-gradient(45deg, #f3ec78, #af4261); background-size: 100%; -webkit-background-clip: text; -moz-background-clip: text; -webkit-text-fill-color: transparent; -moz-text-fill-color: transparent; }