css实现网格背景

代码如下:

1
2
3
4
5
6
7
8
9
.grid{
background:#ccc;
background-image: linear-gradient(white 0px,transparent 0),
linear-gradient(90deg, white 0px,transparent 0),
linear-gradient(hsla(0,0%,100%,.3) 1px,transparent 0),
linear-gradient(90deg,hsla(0,0%,100%,.3) 1px,transparent 0);
background-size:75px 75px,75px 75px,15px 15px,15px 15px;
}

效果图:

image.png