<div class="bg-gradient-to-r from-cyan-500 to-blue-500 ">
. . . .
I have tried the above code. But it's a linear gradient, I want a vertical gradient.
But it's a linear gradient, I want a vertical gradient.
linear is a type of gradient, vertical is a direction. You probably mean that you have a horizontal gradient but instead you want a vertical one. Both will be linear though (for example radial gradient does not exist in Tailwind right now, only linear exists).
All default available directions that you can use for linear gradient:
bg-gradient-to-tbg-gradient-to-trbg-gradient-to-rbg-gradient-to-brbg-gradient-to-bbg-gradient-to-blbg-gradient-to-lbg-gradient-to-tlSo for vertical direction just use bg-gradient-to-t (from bottom to top) or bg-gradient-to-b (from top to bottom)
More info in the docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With