【发布时间】:2012-01-14 00:16:18
【问题描述】:
好吧,这让我发疯了。在 IE8 中,背景渐变图像不会显示在页眉或页脚中,但其他背景图像会显示。我在 IE9、Firefox、Chrome、Safari 或 Opera 中没有问题。我已经在这里和其他地方寻找建议的解决方案,但到目前为止都没有奏效。使用 HTML5 和 CSS3,我知道这在旧浏览器中有时很时髦。
这是页脚的代码:
footer {
text-align:center;
color:#f9f2e7;
font-size:14px;
display:block;
background: #26b6c9;
background-image:url(images/bg-footer.png);
background-repeat:repeat-x;
background-attachment:scroll;
position:relative;
height:103px;
clear:both;
width:100%;
float:left;
}
这是标题:
header {
background: #26b6c9;
background-image:url(images/bg-header.png);
background-repeat:repeat-x;
background-attachment:scroll;
margin: 0 auto;
position:relative;
height:159px;
width:100%;
float:left;
}
我尝试过 display:block 和 shorhand 代码,例如 background: url(images/bg-footer.png) repeat-x top left scroll;但两者都不起作用。
本站的测试区可以找到here。当我注意到这个问题时,我正在开始将其转换为 WordPress 模板,因此 CSS 可能仍然有点混乱。
【问题讨论】:
-
你检查IE8是否支持你想要的HTML5的功能?
标签: html css internet-explorer-8