html - IE 10、11 背景大小问题

标签 html css internet-explorer background-image

在这里查看我的演示页面 http://maze.andmorestuff.com/ 我已将背景大小设置为 100% 100%,这在除 Internet Explorer 9、10、11 之外的所有浏览器中都可以正常工作。这是 Css:

body {
  color: #5c5c5c;
  font-family: Helvetica, Arial, sans-serif;
  background-color: #ffffff;
  background-image: url("https://s3.amazonaws.com/themescdn/52fe33b4a9b5f3dshowroom01.jpg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: scroll;
}

你能告诉我为什么它不能在 IE 上运行吗?或者您可以提出解决此问题的建议吗?

最佳答案

如评论中所述,background-size在 IE9+ 中受支持(所以这不是问题所在)

问题是 body 没有高度。给予<html> 100% 的高度对我有用,但你也可以通过添加 clearfix 来让它工作到 body ,以便清除漂浮的后代。

截图:

http://linenwoods.com/test.jpg

关于html - IE 10、11 背景大小问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21783147/

相关文章:

jquery - IE7,悬停 div 仅对鼠标悬停在边框上有反应

html - 如果比屏幕长,IE8 选择下拉列表将不会显示

internet-explorer - IE9 不渲染背景图片

html - 占用额外空间的CSS问题

python - Beautiful Soup 过滤功能无法找到表的所有行

php - 是否可以在 js 脚本中包含一个 php 文件并访问该 php 文件的功能?

javascript - 迭代 ul 中的每个 li

html - 我想在所有内容图像上应用 css class(bootstrap) .img-responsive

html - 如何在 Google App Script 的 HTML 服务中插入完全适合的背景图片?

javascript - 我如何将按钮向上移动?