2010-10-15 120 views
2

我的网站(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

改变'transparent'为'red'预期在所有的浏览器,当我尝试它的作品。 – Emmett 2010-10-15 21:01:10

回答

1

您可以在CSS中使用background-color属性,将颜色设置为图像的底部颜色。例如:

background-color:#00ff00; 
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; 
    } 
+0

'background-color'似乎填满整个屏幕......没有图像的标志 – Ortund 2010-10-18 23:11:11