线性渐变
语法:linear-gradient(to bottom,colorStrat,colorEnd)
第一个参数指定 渐变的方向
- to bottom 从上至下;
- to bottom right 从左上至右下;
- to right 从左至右;
- to up right 从左下至右上;
- to up 从下至下;
- to up left 从右下至左上;
- to left 从右至左;
- to bottom left 从右上至左下
第二个参数 指定渐变色的开始颜色
第三个参数 指定渐变色的结束颜色
设置偏移量
background: linear-gradient(to bottom,yellow 20%,blue 70%)
颜色的渐变,明显分界线
background: url(../../assets/img/main-div-greenbg.png) no-repeat,
linear-gradient(to bottom, #3bc767 0%, #35aa37 75%, #addbac 76%, #addbac 100%);
background-position: center right;
background-position属性
需要 2 个参数值,第一个值用于横坐标,第二个值用于纵坐标,默认值为 0% 0%