css 设置渐变色


语法:

background-image: linear-gradient(direction, color-stop1, color-stop2, ...);

/* 从上到下,蓝色渐变到红色 */

linear-gradient(blue, red);

/* 渐变轴为45度,从蓝色渐变到红色 */

linear-gradient(45deg, blue, red);

/* 从右下到左上、从蓝色渐变到红色 */

linear-gradient(to left top, blue, red);

/* 从下到上,从蓝色开始渐变、到高度40%位置是绿色渐变开始、最后以红色结束 */

linear-gradient(0deg, blue, green 40%, red);

0deg=to top;

90deg=to right;

180deg=to bottom;

-90deg=to left;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM