Open In App

CSS repeating-linear-gradient() Function

The repeating-linear-gradient() function is an inbuilt function in CSS that is used to repeat linear gradients. 

Syntax:



background-image: repeating-linear-gradient( angle | to side-or-corner, color-stop1,
color-stop2, ...);

Parameters: This function accepts many parameters which are listed below:

Below example illustrates the repeating-linear-gradient() function in CSS: 



Example 1: 




<!DOCTYPE html>
<html>
 
<head>
    <title>repeating-linear-gradient() Function</title>
    <style>
        #main {
            height: 200px;
            background-color: white;
            background-image: repeating-linear-gradient(#090,
                    #fff 10%, #2a4f32 20%);
        }
 
        .gfg {
            text-align: center;
            font-size: 40px;
            font-weight: bold;
            padding-top: 80px;
        }
 
        .geeks {
            font-size: 17px;
            text-align: center;
        }
    </style>
</head>
 
<body>
    <div id="main">
        <div class="gfg">
            GeeksforGeeks
        </div>
        <div class="geeks">
            A computer science portal for geeks
        </div>
    </div>
</body>
 
</html>

Output: 

Example 2: 




<!DOCTYPE html>
<html>
 
<head>
    <title>repeating-linear-gradient() Function</title>
    <style>
        #main {
            height: 200px;
            background-color: white;
            background-image: repeating-linear-gradient(45deg,
                    blue, green 7%, white 10%);
        }
 
        .gfg {
            text-align: center;
            font-size: 40px;
            font-weight: bold;
            padding-top: 80px;
        }
 
        .geeks {
            font-size: 17px;
            text-align: center;
        }
    </style>
</head>
 
<body>
    <div id="main">
        <div class="gfg">
            GeeksforGeeks
        </div>
        <div class="geeks">
            A computer science portal for geeks
        </div>
    </div>
</body>
 
</html>

Output:

 

Supported Browsers:


Article Tags :