Linear Gradients:线性渐变

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

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

  默认是从上到下的,可以把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);

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄