JeffUK
0
Q:

how to insert gradient in css

body{
  background-image: linear-gradient(45.34deg, #EA52F8 5.66%, #0066FF 94.35%);
}
1
#grad {
  background-image: linear-gradient(to right, #f1b1b1 , #82e6e8);

}
3
body{
  /*Radial Gradient*/
  background-image: radial-gradient(#EA52F8 5.66%, #0066FF 94.35%);
  /*Linear Gradient*/
  background-image: linear-gradient(45.34deg, #EA52F8 5.66%, #0066FF 94.35%);
}
1
.foo {
	background-image: linear-gradient(red, blue);
}
8
The general syntax of linear-gradient is-
background: linear-gradient(gradient direction, color1 , color2 , color3, .....);

Forexample-
background: linear-gradient(46deg,green,blue,yellow,pink);

NOTE: (common mistake) we forget to write the semi-colon (;) 
1
/*From bottom to top*/
background: rgb(166,166,166);
background: linear-gradient(0deg, rgba(166,166,166,1) 0%, rgba(255,255,255,1) 29%);
0

New to Communities?

Join the community