CSS颜色渐变


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);


免责声明!

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



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