1、线性渐变,也可以设置偏移量

  background: linear-gradient(方向,color1 ,color2);

 看看效果:

关于css如何实现背景颜色渐变的个人小结关于css如何实现背景颜色渐变的个人小结

 

 

 

 

关于css如何实现背景颜色渐变的个人小结关于css如何实现背景颜色渐变的个人小结

 

 

 

 

linear-gradient第一个参数指定 表示渐变的方向,从哪向哪渐变
to bottom 从上至下;to bottom right 从左上至右下;to right 从左至右;to up right 从左下至右上;
to up 从下至下;to up left 从右下至左上;to left 从右至左;to bottom left 从右上至左下

第二个参数 指定渐变色的开始颜色,第三个参数 指定渐变色的结束颜色

2、放射性渐变

background:radial-gradient([direction],color1,color2);关于css如何实现背景颜色渐变的个人小结

关于css如何实现背景颜色渐变的个人小结

 

 

 

 

 

 

 

 

 

 

 

第一个参数可选 ;指定扩散方向,参数前是不是要有at。

center center;left top;center top;right top;right center;right bottom;center bottom;left bottom

 

 

 

 

 

相关文章:

  • 2021-11-09
  • 2021-12-16
  • 2022-01-12
  • 2021-10-14
  • 2021-06-26
  • 2021-12-22
  • 2022-02-09
猜你喜欢
  • 2021-05-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-20
  • 2022-12-23
  • 2021-04-19
相关资源
相似解决方案