Linear gradient with rainbow color

CSSJavascriptHTML

To create a linear gradient that looks like rainbow color, you can try to run the following code\

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         #demo {
            height: 100px;
            background: linear-gradient(to right, red,orange,yellow,green,blue,indigo,violet);
         }
      </style>
   </head>
   <body>
      <h2>Linear Gradient</h2>
      <div id = "demo">Rainbow</div><br>
   </body>
</html>
raja
Published on 16-May-2018 16:52:41
Advertisements