css 背景图片添加在 body 上时,自适应
html
<body class="bg"> <div> </div> </body>
css
.bg { background: url(../images/bg.jpg) no-repeat 0px 0px; background-size: cover; background-attachment: fixed; }
html
<body class="bg"> <div> </div> </body>
css
.bg { background: url(../images/bg.jpg) no-repeat 0px 0px; background-size: cover; background-attachment: fixed; }