Table of Contents

CSS - Gradient

About

Color gradient in CSS are created via gradient functions that creates an image.

Functions

CSS - Function

The definitions and whole list can be found in the specification.

Example

linear-gradient

With the linear-gradient 1) function.

linear-gradient() = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list>)

where:

Example: the french flag

.french-flag {
  background-image: linear-gradient(to right, blue 0% 33%, white 33% 66%, red 66% 100%);
  height:100px;
  width:200px;
  border: 1px solid grey;
}
<div class="french-flag"></div>

Documentation / Reference