0

I am using this scheme for desktop background. For the homepage I am using the body tag with the class "gd", so the background is given on the home page. The given css is working fine in FF,Chrome,Safari but I am having problem hacking it for IE.

body{  
color:#0066cc;  
background:white;  
padding-top:20px;  
min-width:500px;  
height:100%;  
}

and this style for the main page

body.gd{  
background:#87ceeb url("../images/bg.jpg") bottom center no-repeat !important;  
background-color:#87ceeb !important;  /*P.S. This line just added for testing */  
}

The last line in .gd class is not even showing the background color, it might be possibility that IE is not accepting the body tag with gd class, but in this class how may overcome this behaviour.

P.S. I am using IE9,IE8 and IE7. Three of them are not showing.

4

1 回答 1

0

感谢@7th评论的帮助。这里的问题在于 html 标签。

这是以前

html{  
background-color:#ffffff;  
zoom:1;  
**background-color:transparent\9;**  
-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff, endColorstr=#ffffffff)";  
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff, endColorstr=#ffffffff);  
padding:0;  
margin:0;  
}

之后

html{  
background-color:#ffffff;  
padding:0;  
margin:0;  
}

然后我意识到background-color:transparent出错了。我不知道为什么 IE 将它继承到后台,即使我为 body 标签添加了单独的样式定义。无论如何,现在,它对我来说很好。

PS对此的解释将不胜感激

于 2013-01-07T03:57:52.617 回答