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.
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>

Discussions

please let me know how to add gradient in text..?
Or make it a clipping mask More on reddit.com
🌐 r/photoshop
14
2
December 26, 2022
How to Add Gradient Text in CSS and Animate It! 🎨✨
https://web.dev/articles/speedy-css-tip-animated-gradient-text Numerous other examples online. Just do a query More on reddit.com
🌐 r/css
1
5
October 17, 2024
Why is there no way to directly apply a gradient to a text?!
It’s now available! 🙌 we’ve just released an app called TypeGradient that will let you do just that in couple of seconds! More on reddit.com
🌐 r/canva
10
5
November 17, 2023
How to apply a gradient to text?
I would do this as follows: Arrange your text, Add a transparent layer, Form the text layer use 'alpha to selection', add a layer mask to the transparent layer and initialize it to the selection', get rid of the selection, hide the text layer, apply a gradient to the transparent layer (be careful not to put the gradient into the mask but on the actual layer). More on reddit.com
🌐 r/GIMP
10
8
March 5, 2019
🌐
Webflow Help Center
help.webflow.com › hc › en-us › articles › 33961294318867-Text-fills
Gradient text fill
Let’s first add a Heading to our page and set its font to something that’s a heavier weight so we can see our text fill within its characters: ... Set as many gradient stops as you’d like and click the color picker to choose a color for each gradient stop · Adjust the angle of your gradient by clicking and dragging the direction dial dot, pressing the arrows, or typing in ...
🌐
Fossheim
fossheim.io › writing › posts › css-text-gradient
How to add a gradient overlay to text with CSS by Sarah L. Fossheim
To add a gradient overlay to a text element, we need to set three different CSS properties to the text we want to style: ... To make the gradient cover the full width and height of your text field, set background-size: 100%, which is what I ...
🌐
Edit.org
edit.org › blog › news-add-gradients-to-your-texts-online
Online Gradient Text Generator
This type of text with gradient and color combinations is common in graphic design to make logos, web designs, banners, brochures, and posters in general. Customize gradients from our online editor from your phone, tablet, or computer. Create letters with gradients as if you were a design professional in seconds, easily, and with clicks. You can use them to highlight specific words or add ...
Find elsewhere
🌐
Envato Tuts+
design.tutsplus.com › home › design & illustration › add-ons › text effects
How to Make Gradient Text in Illustrator | Envato Tuts+
March 3, 2024 - There are two methods that you can use to apply a gradient to text in Illustrator. For the first method, select your text and go to the Appearance panel (Window > Appearance). Click the Add New Fill button and make sure that the newly added ...
🌐
SitePoint
sitepoint.com › blog › css › quick tip: how to add gradient effects and patterns to text
Quick Tip: How to Add Gradient Effects and Patterns to Text — SitePoint
April 6, 2024 - You may have noticed that I’ve used the background-image property in the examples above rather than the background shorthand. Either works fine, but there’s one gotcha if you’re using background. You need to declare it first, before background-clip. Otherwise, the background property resets background-clip to its default of border-box, and the effect doesn’t work. ... color: transparent; background: linear-gradient(to right, #3b82f6, #c084fc, #db2777); background-clip: text;
🌐
Reddit
reddit.com › r/photoshop › please let me know how to add gradient in text..?
r/photoshop on Reddit: please let me know how to add gradient in text..?
December 26, 2022 - Double click the layer and choose gradient overlay. ... Don’t rasterise, try instead to be non-destructive in your process by using smart/vector objects and editable text layers. ... Save your text layer as a smart object. Double-click through and add a gradient overlay...
🌐
Gradient Page
gradient.page › css › text-gradient
How to create Linear Text Gradients quickly in CSS & HTML
To create a linear color gradient effect on text, set a gradient as the background color and make the text transparent. This is done using CSS properties like background-image and background-clip.
🌐
GeeksforGeeks
geeksforgeeks.org › web templates › how-to-create-linear-gradient-text-using-html-and-css
How to create linear gradient text using HTML and CSS ? - GeeksforGeeks
July 15, 2025 - Please refer linear-gradient() method to create a gradient background and then use webkit properties to overlay that background with our text. Example: In the following section, the text used for demonstration is wrapped inside the h1 tag.
🌐
Coding Help Wikia
coding-help.fandom.com › wiki › Gradients
Gradients | Coding Help Wikia | Fandom
January 9, 2026 - The pixel attribute determines at which specific pixel you want a color to stop being solid. Start with a gradient code like this: <div style="background:linear-gradient(to left, blue, cyan);">Insert text here</div>
🌐
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 ...
🌐
Reddit
reddit.com › r/css › how to add gradient text in css and animate it! 🎨✨
r/css on Reddit: How to Add Gradient Text in CSS and Animate It! 🎨✨
October 17, 2024 -

Hey everyone! If you're looking to give your website a more stylish and modern look, gradient text is a fantastic way to do it! You can apply gradients to text using CSS, making your headlines or key content really pop.

  1. Creating Gradient Text in CSS

To create gradient text, you can use a combination of a background gradient and a text clipping technique. This gives your text the appearance of being filled with a smooth blend of colors, rather than just one solid color. It’s a great way to make your text stand out, and it works really well with modern web design trends.

2. Animating the Gradient

You can take things a step further by adding animations to your gradient text! Imagine your gradient colors slowly shifting from left to right, or cycling through different shades. CSS makes this pretty easy with keyframe animations. It can give your website a dynamic and visually engaging effect without requiring any JavaScript.


Want to learn exactly how to do this? I’ve made a few videos explaining how to create gradient text, animate it, and more cool CSS tricks! Check out my YouTube channel @HoverHacks, where I break down web development tips and tutorials in a simple and easy-to-understand way.

🌐
Reddit
reddit.com › r/canva › why is there no way to directly apply a gradient to a text?!
r/canva on Reddit: Why is there no way to directly apply a gradient to a text?!
November 17, 2023 -

Like, I dont get it. I pay for premium here because everything else is so good, but why in seven hells does every free program offer the ability to easily apply a gradient to text, and this one doesn’t?

Honestly, I dont get it. All methods shown online evolve like 10 steps to apply a gradient.

🌐
Reddit
reddit.com › r/gimp › how to apply a gradient to text?
r/GIMP on Reddit: How to apply a gradient to text?
March 5, 2019 -

Hi,

I've gone to like 10 different tutorials on how to add a gradient to text, and I am following every one to the letter and I still can't seem to do it right. I highlight the text, I select the gradient tool, and I apply my colors. So far it works. But after deselecting the text, now the entire box has a gradient and I don't want that, I just want the text to have it. Checking "instant mode" works but now I can't adjust it properly.

🌐
Bring Your Own Laptop
bringyourownlaptop.com › blog › mastering-gradient-text-in-illustrator-a-step-by-step-guide
Create Stunning Gradient Text in Illustrator: Step-by-Step Tutorial | Bring Your Own Laptop
October 21, 2025 - Click on the Add New Fill button to edit the text element with a new gradient. Next, we click on the Fill option and select the gradient swatch from the Swatches Panel. And there we have it!
🌐
Office Watch
office-watch.com › home › gradient effects and text in word - in depth
Gradient Effects and Text in Word - in depth - Office Watch
January 1, 2023 - To add a gradient effect to text, select the text, then on the Font group of the Home tab, click the arrow next to the font color button. At the bottom of the dropdown, select Gradient.