在电脑版中展开 <500px 时,背景看起来应该。在移动版后台“曲线”。
html
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
css
@media screen and (max-width: 500px) {
body {
background-image: url("../img/background-body-500px.jpg");
background-position: center;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-attachment: fixed;
}
}