背景灰色 [英] Background Grey
问题描述
在某些浏览器中,我的网站 http://haptotherapiemris.nl ,背景显示为灰色块。
In some browsers, my website http://haptotherapiemris.nl, the background appears with grey blocks.
这是我的后台css代码:
This is my background css code:
.main {
margin: 0 auto;
background: transparent url(http://dansolution.nl/klanten/background/bg.jpg) repeat-y center top;
width: 1000px;
min-height: 1000px;
text-align: center;
background-repeat: no-repeat;
background-attachment: fixed;
}
推荐答案
您的问题是什么?
如果您不指定浏览器,则会使用自己的预设背景颜色。在你的情况下,你为div.main指定了一个透明的背景颜色,这正是你期望的 - 它是无色的,显示div.main后面的元素。 div.main后面的元素是body,它有一个背景颜色:#595959。这是您的网页背景为灰色的原因。
Browsers will use their own default background color if you do not specify one. In your case, you've specified a background color of "transparent" for div.main, which does exactly what you'd expect--it is colorless, showing the element behind div.main. The element behind div.main is body, which has a background-color:#595959. This is why your page background is grey.
资料来源:
http://www.w3schools.com/css/css_background.asp
这篇关于背景灰色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!