css gradient div code example

Example 1: css linear gradient

#grad {
  background-image: linear-gradient(to right, #f1b1b1 , #82e6e8);

}

Example 2: css gradient

Here a codePen with cool gradient animations:
https://codepen.io/DevLorenzo/pen/ExgpvJM

Example 3: linear gradient in CSS

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

Tags:

Css Example