linear gradient background image code example

Example 1: how to insert gradient in css

body{
  /*Radial Gradient*/
  background-image: radial-gradient(#EA52F8 5.66%, #0066FF 94.35%);
  /*Linear Gradient*/
  background-image: linear-gradient(45.34deg, #EA52F8 5.66%, #0066FF 94.35%);
}

Example 2: background with image and gradient

body {
  background: #eb01a5;
  background-image: url("IMAGE_URL"); /* fallback */
  background-image: url("IMAGE_URL"), linear-gradient(#eb01a5, #d13531); /* W3C */
}

Example 3: linear-gradient(top to bottom)

/* A gradient going from the top to bottom
   starting red and finishing orange */

.class {
    background: linear-gradient(to bottom, #f32b60, #ff8f1f);
}

Example 4: linear gradient css background image

background-image: url("IMAGE_URL"), linear-gradient(#eb01a5, #d13531);

Example 5: css linear gradient

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

}

Example 6: css horizontal linear gradient

background: linear-gradient(to left, red, blue);

Tags:

Css Example