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

前端 未结 7 1595
暗喜
暗喜 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:20

    You can fix this by using long transition delays to prevent the element resizing.

    eg:

    transition: height 250ms 600s; /*10min delay*/
    

    The tradeoff with this is it prevents resizing of the element including on device rotating, however you could use some JS to detect orientationchange and reset the height if this was an issue.

提交回复
热议问题