How to add linear gradient effect in css?

What is the linear gradient and how to use it??

1 Like

Linear gradient is used to create a background consisting of a transition between two or more colors along a straight line.

You can use the background property or background property image or background color for applying linear-gradient color. To use linear gradient color first we need to write the keyword “linear-gradient”. In the parentheses first, we pass direction and then we pass one or more color stops as in the above syntax.

Background:linear-gradient(direction, color-stop 1, color-stop 2,......last-color-stop );

or

Background-image:linear-gradient(direction, color-stop 1, color-stop 2,......last-color-stop );

or

Background-color:linear-gradient(direction, color-stop 1, color-stop 2, ......last-color-stop);
3 Likes