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

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         #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);
         }
      </style>
   </head>
   <body>
      <h2>Linear Gradients</h2>
      <div id = "demo1">0 degree</div><br>
      <div id = "demo2">90 degrees</div><br>
      <div id = "demo3">-90 degrees</div>
   </body>
</html>
raja
Published on 16-May-2018 09:10:30
Advertisements