1、线性变色
语法:
background-image: linear-gradient(direction, color-stop1, color-stop2, ...);
示例:
background-image: linear-gradient(to right,rgb(128,189,60),rgb(80,171,140),rgb(35,155,215));
效果:
其中方向有一下四种:
to bottom | 默认值,从上到下 |
---|---|
to top | 从左到右 |
to left | 从右到左 |
to bottom right | 从左上到右下 |