我想创建一个淡出的网格背景
到目前为止,我已经try 了圆锥梯度背景,但我不确定如何使其淡出
background:
conic-gradient(from 90deg at 1px 1px,#0000 90deg,grey 0)
0 0/50px 50px;
我想创建一个淡出的网格背景
到目前为止,我已经try 了圆锥梯度背景,但我不确定如何使其淡出
background:
conic-gradient(from 90deg at 1px 1px,#0000 90deg,grey 0)
0 0/50px 50px;
最简单的解决方案是添加一个从透明到白色的linear-gradient
的背景图像:
body {
background:
linear-gradient(180deg, #FFF0 0%, #FFFF 100%) 0 0 / 100dvw 100dvh,
conic-gradient(from 90deg at 1px 1px, #8880 90deg, #888F 0) center -1px / 50px 50px;
}
或者,如果你使用一定的身体高度:
* { margin:0; box-sizing: border-box; }
body {
min-height: 100vh;
background:
linear-gradient(180deg, #FFF0 0%, #FFFF 100%),
conic-gradient(from 90deg at 1px 1px, #8880 90deg, #888F 0) center -1px / 50px 50px;
}