【问题标题】:IE doesn't show my bottom background-imageIE 不显示我的底部背景图像
【发布时间】:2013-01-29 02:48:32
【问题描述】:

我创建了一个网页,它使用两张图片作为背景 - 一张用于顶部,一张用于底部。 Chrome、Safari 和 Firefox 显示页面没有问题,但在 IE 中,底部的背景不显示。这是我正在使用的代码:

html {
  font:100%;
  background:url(../images/test8-300.jpg) repeat-x, url(../images/Html-background-Bottom2.png) no-repeat bottom;
  background-color:#d7d7d7;
}

如果您需要看一下以更好地理解,这是地址:doggiestime.co.uk。在底部,您应该能够看到一些狗。

【问题讨论】:

标签: css html


【解决方案1】:

试试

background:#fff repeat-x no-repeat bottom;
background-image:url(../images/test8-300.jpg), url(../images/Html-background-Bottom2.png);

【讨论】:

  • 我在 IE9 上进行测试,甚至在我的运行 win8 的笔记本电脑上进行测试,它有 IE10 的预览版。
  • 低于 9 的 IE 版本不支持多背景图片。尝试将背景设置为身体,如下面的 Keeg 建议。
  • 我试过你的代码,但没有解决问题。有了它,我的顶部图像垂直重复,底部背景图像仍然根本不显示。无论如何,感谢您的宝贵时间!
【解决方案2】:

你需要将你的背景图片设置为<body>标签而不是<html>

body {
  font:100%;
  background:url(../images/test8-300.jpg) repeat-x, url(../images/Html-background-Bottom2.png) no-repeat bottom;
  background-color:#d7d7d7;
}

【讨论】:

    猜你喜欢
    • 2022-11-21
    • 1970-01-01
    • 1970-01-01
    • 2018-08-06
    • 2019-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-19
    相关资源
    最近更新 更多