1. Home
  2. Css
  3. Linear background gradient
#css#background

Set gradient background of the element. The first attribute is for the gradient's angle, choose from "to bottom", "to right", a mixed approach "to bottom left" or a degree value like "-10deg".

<style>
    .element{
        /* background-image: linear-gradient(direction, color-1, color-2, ...); */
        
        /* If the direction isn't set the gradient will be set top to bottom by default. */
        background-image: linear-gradient(start-color, end-color);
        
        /* You can use multiple colors too */
        background-image: linear-gradient(to left, #111c3a, #192850);
    }
</style>
copy
Full Css cheatsheet
Sitemap Git repository