背景图片大小不工作在IE 8 [英] Background image size is not working in IE 8
问题描述
我的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;
}
background-size在IE8中无效,如何解决这个问题没有任何想法,请帮助我。
background-size is not working in IE8,How to fix this problem,I dont have any idea,Please help me.
推荐答案
IE8不支持背景图像选项。您可以使用 caniuse.com 网站查看各种HTML5功能的浏览器支持列表,例如 background-size
。或者,如果需要IE8支持,则需要在< div id =content_main后面使用
< img>
>
IE8 does not support background-image options. You can use the caniuse.com website to see browser support matrices for various HTML5 features like background-size
. Alternatively, if IE8 support is required, you'll need to use an <img>
tag set behind your <div id="content_main">
按照@ ahsan的建议检查这个其他类似问题,其中包含一些polyfill建议和 ms-filter
解决 background-size
in IE8
Follow @ahsan's recommendation to check out this other similar question which contains some polyfill suggestions and an ms-filter
work-around for background-size
in IE8
这篇关于背景图片大小不工作在IE 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!