我的网站(http://www.webbuddies.co.za)效果很好,但是当以1280x1024分辨率观看时,页面底部会显示一些我想要摆脱的白色。 背景是渐变图像,而不是重新创建图像,我只想更改背景的颜色以匹配渐变的底部。可以这样做吗?
这是我的CSS:
body {
background: transparent url("Images/Background.png") repeat-x;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
如果我将transparent
更改为某种颜色,图像会消失......有任何想法吗?
提前致谢!
答案 0 :(得分:1)
您可以在CSS中使用background-color属性,将颜色设置为图像的底部颜色。例如:
background-color:#00ff00;
答案 1 :(得分:1)
只需设置一个额外的背景颜色,如下所示:
body {
background-image:url("Images/Background.png");
background-repeat:repeat-x;
background-color:#999999; /* << inset your gray here */
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}