background-image: linear-gradient(45deg, transparent 0, transparent 40%, #163663 40%, #163663 50%, transparent 50%, transparent 90%, #163663 75%, #163663);
background-size: 10px 10px;
45deg表示条纹倾斜角度,不加这个属性为横条纹,-45deg指向左上角
后面属性都是颜色值,transparent为透明,即可以显示背景色,最后一个百分比1可以省略
(0,40%)是背景色
(40%,50%)是条纹色
(50%,90%)是背景色
(90%,100%)是条纹色
background-size: 10px 10px;就把上图的样式缩小到了10*10的方格子中
另外background-repeat的默认repeat发挥作用,把渲染好的10*10方格子平铺重复渲染到容器里面
改变斜条纹线条的大小,只需要改变background-size的大小
background-size: 50px 50px;
background-size: 10px 10px;