0 points

How to Make a Linear Gradient in CSS


dashboard

Wed Jan 08 2020 19:00:00 GMT+0000 (UTC)

Posted by @solitaire_4_07 #css #design #gradient

.gradient {
  background-image:
    linear-gradient(
      to right, 
      red, 
      blue,
      yellow, 
      green
    );
}
content_copy

line 4: specifies the direction. Can also be defined in degrees. e.g. "45 deg" line 5-8: can specify as many colours as you want in the gradient. At least two different colours needed to form a gradient.





LISTS WITH THIS SNIPPET

>> Browse more code snippets

more_vert