背景图片适配手机屏幕大小的设置方法。。。。。。。。。。。。

1 .bg{    
2         100%;
3         height:100%;
4         background-image: url(../image/splash.png); 
5         background-size: 100% 100%;
6         background-size: cover;
7         position: fixed; ----重点
8       display: block;
9 }
    <style type="text/css">
    *{
        margin:0;
        padding: 0;
    }
        body {
             100%;
            height: 100%;
            overflow: scroll;
        }
        
        img {
             100%;
        }
    </style>

    <body>
        <img src="huodongye.png" />
    </body>
原文地址:https://www.cnblogs.com/kangshuai/p/5090931.html