2014-02-12 99 views
1

http://apolytos.com/new/img/test.html背景固定&盖 - Internet Explorer的11

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<style> 
body { 
    background:url("background.jpg"); 
    background-repeat:no-repeat; 
    background-attachment:fixed; 
    background-size: cover; 
    background-position:top center; 
    margin:0; 
} 
</style> 
</head> 
<body> 
</body> 
</html> 

的Internet Explorer 11未覆盖;查看提供的链接。如果我删除了:固定的,它会覆盖原本应该的内容,但是bg会滚动页面上的内容,这是不需要的。在IE中,这两行代码似乎有冲突。

+0

哟,你有一个的jsfiddle? –

+0

负面ghostrider – Robb

回答

0

试试这个代码,它应该很好。

html { 
    background: url(images/bg.jpg) no-repeat center center fixed; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
} 
+0

背景大小不需要前缀 –

+0

当你使用过时的浏览器 –

+0

没有变化,仍然是相同的 – Robb

0

尝试使用背景图片更换滤芯,这意味着用作标签

+0

你会举一个例子吗?我不完全跟着 – Robb

+0

试着把lyk image和.img {position:absolute;顶部:0;宽度:100%;高度:100%;} –