1/* A gradient tilted 100 degrees,
2 starting gray and finishing black */
3
4.class {
5 background: linear-gradient(100deg, rgba(63, 63, 63, 0.8) 0%, rgba(255, 255, 255, 0) 25%);
6}
7
8/* A gradient going from the bottom to top
9 starting red and finishing orange */
10
11.class {
12 background: linear-gradient(to top, #f32b60, #ff8f1f);
13}
14
1.yourElementClass{
2 background: linear-gradient(to top, #fff000 0%, #000fff 100%);
3 /* 1st property: from where the 100% starts */
4 /* 2nd property: the first color */
5 /* 3rd property: the second color */
6 /* to add some colors to the gradient, do the same thing of 2nd and 3rd properties, edit the color and the color-stop */
7}
1Here a codePen with cool gradient animations:
2https://codepen.io/DevLorenzo/pen/ExgpvJM
1background: linear-gradient(Direction (keyword or degrees), color1 10% (10% width), color2 width (it's not neccessary), ...);