css multicolor background code example

Example 1: linear-gradient

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

Example 2: 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 (;)

Example 3: double color background css

background: linear-gradient(<angle>, color1 color1-stop-at, color2 color2-start-at);

Example 4: css multicolor background

background: linear-gradient(110deg, #fdcd3b 60%, #ffed4b 60%);

Tags:

Css Example