CSS background stretches to fill height in iOS but there is white space on scroll

前端 未结 7 1596
暗喜
暗喜 2021-02-06 18:57

this CSS gets my background to fill 100% of the screen height in iOS but there is a minor problem - when you scroll down there is initially white space, then when you release yo

7条回答
  •  遥遥无期
    2021-02-06 19:40

    html, body {
        display: block;
        height:  100%;
        width:   100%;
    }
    
    body {
        background-image:      url('some/image.jpg');
        background-repeat:     repeat-x;
        background-attachment: fixed;
        background-position:   center center;
        background-size:       contain;
    }
    

    jsfiddle

提交回复
热议问题