在这里查看我的演示页面 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 ,以便清除漂浮的后代。
截图:
关于html - IE 10、11 背景大小问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21783147/