2013-10-20 50 views
0

在某些浏览器中,我的网站http://haptotherapiemris.nl,背景显示为灰色块。背景灰

这是我的背景CSS代码:

.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; 
} 

回答

1

检查你的身体风格:

style.css线2
body { 
background-color: #595959; /* here is the color */ 
margin: 0 auto; 
padding: 0; 
width: 100%; 
color: #595959; 
font: normal 13px/1.8em Tahoma, Arial, Helvetica, sans-serif; 
text-align: center; 
letter-spacing: 0.06em; 
} 

你需要从车身风格删除background-color

1

好的。你有什么问题?

如果您未指定浏览器,则浏览器将使用其自己的默认背景色。在你的情况下,你已经为div.main指定了一个“透明”的背景颜色,它完全符合你的期望 - 它是无色的,显示div.main背后的元素。 div.main后面的元素是body,它具有背景色:#595959。这就是为什么你的页面背景是灰色的。

信息来源: http://www.w3schools.com/css/css_background.asp