[英]CSS3 IE9 background-size: cover; doesn't always work
This is killing me, i have a background picture that is doing full screen using background-size: cover;. 这是杀了我,我有一个背景图片,使用背景大小全屏:cover;。 And to my understand IE9 supports this. 据我所知,IE9支持这一点。 Whats killing me is some IE9 browsers are handling this and some IE9 browsers are not. 什么杀死我是一些IE9浏览器正在处理这个和一些IE9浏览器不是。
Anybody experience this before? 以前有人经历过吗?
I have the same problem and i fix it with this declaration in the <head />
: 我有同样的问题,我在<head />
使用此声明修复它:
<meta http-equiv="X-UA-Compatible" content="IE=7; IE=8; IE=9">
. <meta http-equiv="X-UA-Compatible" content="IE=7; IE=8; IE=9">
。
some IE9 browsers are handling this and some IE9 browsers are not. 一些IE9浏览器正在处理这个,而一些IE9浏览器则没有。
Please make sure your Browser Mode
and Document Mode
is IE 9
. 请确保您的Browser Mode
和Document Mode
是IE 9
。 Using F12 developer tools. 使用F12开发人员工具。
I know its old, but i had this problem today and it was killing me too.. but i found a solution: 我知道它的旧,但我今天遇到了这个问题,它也杀了我..但我找到了一个解决方案:
Check if you have the tag <!DOCTYPE html>
in your first line, if you forget that it can make your css3 looks real bad on IE9. 检查你的第一行是否有<!DOCTYPE html>
标签,如果你忘了它可以让你的css3在IE9上看起来很糟糕。
Thanks! 谢谢!
That worked!!! 那工作!!!
Putting <!DOCTYPE html>
as the first line resolved the IE 9 problem (worked before OK with Chrome and IE 10). 将<!DOCTYPE html>
作为第一行解决了IE 9问题(在使用Chrome和IE 10之前正常工作)。 You can see the result of the following code on my page at http://www.cgmdesign.net (background photo is mine). 您可以在我的页面http://www.cgmdesign.net上看到以下代码的结果(背景照片是我的)。
<style>
body {
background: url('images/golf3.jpg');
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center bottom;
}
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.