Check out example codes for "linear-gradient". 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

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

Code Example 3

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

Code Example 4

.element {
    background: linear-gradient(90deg, pink 50%, cyan 50%);
}

Learn ReactJs, React Native from akashmittal.com