Open In App

CSS repeating-linear-gradient() Function

Last Updated : 30 Aug, 2024
Comments
Improve
Suggest changes
1 Like
Like
Report

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:

  • angle: This parameter is used to hold the angle of direction for the gradient. Its value lies between 0 to 360 degrees. By default, its value is 180 degrees.
  • side-or-corner: This parameter is used to define the position of the starting point of the gradient line. It consists of two keywords: the first one indicates the horizontal side, left or right, and the second one the vertical side, top or bottom. The order is not relevant and each of the keywords is optional.
  • color-stop1, color-stop2, ...: This parameter is used to hold the color value followed by its optional stop position.

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

Example 1: 

Output: 

repeating linear gradient Example 2: 

Output:

 

Supported Browsers:

  • Google Chrome 26
  • Edge 12 
  • Firefox 16
  • Microsoft Edge 12
  • Opera 12.1
  • Safari 7

Similar Reads