主页
CSS
CSS 渐变
尝试一下:线性渐变 - 重复
运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #grad1 { height: 200px; background-color: red; /* For browsers that do not support gradients */ background-image: repeating-linear-gradient(red, yellow 10%, green 20%); } #grad2 { height: 200px; background-color: red; /* For browsers that do not support gradients */ background-image: repeating-linear-gradient(45deg,red,yellow 7%,green 10%); } #grad3 { height: 200px; background-color: red; /* For browsers that do not support gradients */ background-image: repeating-linear-gradient(190deg,red,yellow 7%,green 10%); } #grad4 { height: 200px; background-color: red; /* For browsers that do not support gradients */ background-image: repeating-linear-gradient(90deg,red,yellow 7%,green 10%); } #grad5 { height: 200px; background-color: red; /* For browsers that do not support gradients */ background-image: repeating-linear-gradient(45deg, red 0px, red 10px, yellow 10px, yellow 20px); } </style> </head> <body> <h1>Repeating Linear Gradient</h1> <div id="grad1"></div> <p>A repeating gradient on 45deg axe starting red and finishing green:</p> <div id="grad2"></div> <p>A repeating gradient on 190deg axe starting red and finishing green:</p> <div id="grad3"></div> <p>A repeating gradient on 90deg axe starting red and finishing green:</p> <div id="grad4"></div> <p>A repeating gradient on 45deg axe with solid stripes:</p> <div id="grad5"></div> </body> </html>