HTML/CSS:加载时避免图像下方出现黑色背景



这是我的CSS:

body {
color: #ffffff;
background-color: #8f8f8f;
background: url(images/noise_int.png) repeat center; /* fallback */
...
background: radial-gradient(rgba(0, 0, 0, .3) 10%, rgba(0, 0, 0, .8) 90%), url(images/noise_int.png) repeat center, #8f8f8f; /* W3C */
height: auto;
background-size: auto; 
}

(我确实去掉了所有浏览器多余的背景线。)现在我相信背景颜色首先设置为灰色。然后它被告知是一个透明的梯度,在图像的顶部,在灰色色调的顶部。我认为这意味着当图像加载在它下面时,会有灰色色调,但事实并非如此。当图像在下面加载时,它是黑色的。当图像是渐进和交错的时,就会发生这种情况。有没有办法防止这种行为?

background: #000000 url(images/noise_int.png) repeat center;

最新更新