http://apolytos.com/new/img/test.html
<!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未覆盖;请查看提供的链接。如果我去掉:fixed,它会像预期的那样覆盖,但是bg滚动页面上的内容并不是我们想要的。IE中的这两行代码似乎有冲突。
发布于 2014-02-12 16:07:55
试一试这段代码,它应该可以很好地工作。
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;
}发布于 2014-02-12 16:09:25
尝试使用背景图像作为替换元素,这意味着使用标签
https://stackoverflow.com/questions/21721980
复制相似问题