使用repeating-linear-gradient()方法重复线性梯度。
您可以尝试运行以下代码以在CSS中实现repeating-linear-gradient()函数
<!DOCTYPE html> <html> <head> <style> #demo { height: 300px; background: repeating-linear-gradient(green 20%, orange 40%, maroon 40%); } </style> </head> <body> <p>Repeating linear gradient.</p> <div id = "demo"></div> </body> </html>