CSS3 Linear gradients

Linear gradients are used to arrange two or more colors in linear formats like top to bottom.

Example

You can try to run the following code to implement linear gradients in CSS3 −

Live Demo

<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            background: -webkit-linear-gradient(pink,green);
            background: -o-linear-gradient(pink,green);
            background: -moz-linear-gradient(pink,green);
            background: linear-gradient(pink,green);
         }
      </style>
   </head>
   <body>
       <div id = "grad1">
      </div>
   </body>
</html>
Updated on: 2020-06-29T10:09:50+05:30

180 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements