Linear Gradients:线性渐变
background: linear-gradient(direction, color-stop1, color-stop2, ...);
默认是从上到下的,可以把direction改为left就为从左到右渐变
background: linear-gradient(to left, red , blue);
也可以left top,左上到右下
background: linear-gradient(to left top, red , blue);
也可以使用角度,180度
background: linear-gradient(180deg, red, blue);
还有透明度的应用
background: linear-gradient(to right, rgba(255,0,0,0), rgba(255,0,0,1));
Radial Gradients:径向渐变
与线性渐变一样,讲语法改一下就可以了
background: radial-gradient(center, shape size, start-color, ..., last-color);