移动端背景图自适应

时间:2022-03-11 05:27:16

 

/*兼容安卓手机没有高度导致无法显示背景图片*/
html,body{
  width:100%;
  height:100%;
}
body {
  background: url(../../image/download.jpg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-background-size: 100% 100%;
  background-attachment: fixed;
  -webkit-background-attachment: fixed;
}