我想要一个固定的背景图片,如this。
这可以仅使用css而不使用任何jQuery插件吗?
答案 0 :(得分:1)
CSS3方式:(ie9 + etc)
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;
}
jQuery插件跨浏览器方式: http://bavotasan.com/2011/full-sizebackground-image-jquery-plugin/