Check out example codes for "linear gradient in CSS". It will help you in understanding the concepts better.

Code Example 1

background: linear-gradient(to left, #333, #333 50%, #eee 100%);

Code Example 2

\\code for a basic gradient background
   #grad {
  background-image: linear-gradient(red, yellow);
}

Code Example 3

.foo {
	background-image: linear-gradient(red, blue);
}

Code Example 4

background: linear-gradient(to left, red, blue);

Code Example 5

#grad {
  background-image: linear-gradient(red, yellow);
}

Code Example 6

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 (;)

Learn ReactJs, React Native from akashmittal.com