Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a linear gradient to text in Tailwind CSS?

How to add a linear gradient to text/a heading in Tailwind CSS?

I was only able to add it to the background using this:

<h2 className="text-4xl w-full text-white font-extrabold bg-gradient-to-r from-sky-500/20 to-sky-500/75">
       Welcome To <br /> My Personal PortFolio 
</h2>

get

like image 795
Mohit Maroliya B17CS036 Avatar asked Oct 25 '25 21:10

Mohit Maroliya B17CS036


1 Answers

I had figured out a way after an hour's hustle.

<h2 className="text-4xl w-full text-transparent bg-clip-text font-extrabold bg-gradient-to-r from-white to-sky-500/10 p-2">
       Welcome To <br /> My Personal PortFolio 
</h2>

enter image description here

like image 108
Mohit Maroliya B17CS036 Avatar answered Oct 28 '25 12:10

Mohit Maroliya B17CS036



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!