从上到下的线性渐变:
#grad { background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */ background: linear-gradient(red, blue); /* 标准的语法 */ }
从左到右的线性渐变:
#grad { background: -webkit-linear-gradient(left, red , blue); /* Safari 5.1 - 6.0 */ background: -o-linear-gradient(right, red, blue); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(right, red, blue); /* Firefox 3.6 - 15 */ background: linear-gradient(to right, red , blue); /* 标准的语法 */ }
颜色不均匀分布的线性渐变:
#grad { background: -webkit-radial-gradient(red 5%, green); /* Safari 5.1 - 6.0 */ background: -o-radial-gradient(red 5%, green); /* Opera 11.6 - 12.0 */ background: -moz-radial-gradient(red 5%, green); /* Firefox 3.6 - 15 */ background: radial-gradient(red 5%, green); /* 标准的语法 */ }
原文地址:https://www.cnblogs.com/pengxiangchong/p/11654326.html
时间: 2024-11-10 15:09:47