css自适应各种格式背景图
body {
position: relative;
background-color: #eee;
background-image: url(链接);
background-size: 100%;
max-width: 580px;
margin: 0 auto;
}
直接在源代码中插入如下
style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(链接);">
放在<style>标签即可
<style>
body {
position:relative;
background-color: #eee;
background-image: url(链接);
background-size: 100%;
max-width: 580px;
margin: 0 auto;
}
</style>