Computer >> Computer tutorials >  >> Programming >> CSS

How to repeat linear gradients with CSS


To repeat linear gradients with CSS, use the repeating-linear-gradient() function. You can try to run the following code to implement it:

Example

<!DOCTYPE html>
<html>
   <head>
      <style>
         #demo {
            height: 100px;
            background: repeating-linear-gradient(red, yellow 30%, green 30%);
         }
      </style>
   </head>
   <body>
      <h2>Linear Gradient</h2>
      <div id = "demo">Repeating Linear Gradients</div><br>
   </body>
</html>