我的html代码
<div id="content_main"></div>
CSS
#content_main
{
width:1024px;
height:150px;
background:url('../images/Orange.jpg');
background-repeat:no-repeat;
background-size:1024px 150px;
-moz-background-size: 1024px 150px;
-o-background-size: 1024px 150px;
}
背景大小在 IE8 中不工作,如何解决这个问题,我不知道,请帮助我。
最佳答案
IE8 不支持背景图像选项。您可以使用 caniuse.com网站查看各种 HTML5 功能的浏览器支持矩阵,例如 background-size
.或者,如果需要 IE8 支持,您将需要使用 <img>
标签设置在您的 <div id="content_main">
后面
按照@ahsan 的建议查看 this other similar question其中包含一些 polyfill 建议和一个 ms-filter
background-size
的解决方法在 IE8 中
关于html - 背景图像大小在 IE 8 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11200887/