How to use angles on linear gradients using CSS

CSSWeb DevelopmentFront End Technology

Use linear-gradient() to add angle on linear gradients. You can try to run the following code to implement it to set angles as 0, 90, and -90 degrees


Live Demo

<!DOCTYPE html>
         #demo1 {
            height: 100px;
            background: linear-gradient(0deg, orange, blue);
         #demo2 {
            height: 100px;
            background: linear-gradient(90deg, orange, blue);
         #demo3 {
            height: 100px;
            background: linear-gradient(-90deg, orange, blue);
      <h2>Linear Gradients</h2>
      <div id = "demo1">0 degree</div><br>
      <div id = "demo2">90 degrees</div><br>
      <div id = "demo3">-90 degrees</div>
Published on 16-May-2018 12:40:30