首页
CSS
CSS 渐变
尝试:线性渐变 - 使用不同角度
运行 ❯
获取您
自身
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #grad1 { height: 100px; background-color: red; /* For browsers that do not support gradients */ background-image: linear-gradient(0deg, red, yellow); } #grad2 { height: 100px; background-color: red; /* For browsers that do not support gradients */ background-image: linear-gradient(90deg, red, yellow); } #grad3 { height: 100px; background-color: red; /* For browsers that do not support gradients */ background-image: linear-gradient(180deg, red, yellow); } #grad4 { height: 100px; background-color: red; /* For browsers that do not support gradients */ background-image: linear-gradient(-90deg, red, yellow); } </style> </head> <body> <h1>Linear Gradients - Using Different Angles</h1> <div id="grad1" style="text-align:center;">0deg</div><br> <div id="grad2" style="text-align:center;">90deg</div><br> <div id="grad3" style="text-align:center;">180deg</div><br> <div id="grad4" style="text-align:center;">-90deg</div> </body> </html>