Home > Blockchain >  Which CSS property is used for adding gradient colors in background?
Which CSS property is used for adding gradient colors in background?

Time:12-12

In HTML Web page how I can use gradient colors

I want to know the css property

CodePudding user response:

Use the linear-gradient function. Try to use the example below

div {
background-image: linear-gradient(red, blue)};

CodePudding user response:

You can use the linear-gradient() function to generate a linear Gradient. The first property is direction in which your gradient should point. After that you can add the colours you want. There are more gradient types than the Lienar-gradient in css.

Hint: In Future you can google that sort of questions. If you dont Know where to Start Developer Mozilla is greate place :D

body {
    background: linear-gradient(40deg, blue, red, yellow);
}

  • Related