iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue

后端 未结 13 901

We\'re seeing issues with a web app that has a height of 100% on Safari in iOS 7. It appears that the window.innerHeight (672px) doesn\'t match window.outerHeight (692px), b

13条回答
  •  感情败类
    2020-11-27 10:51

    A variant of Samuel's approach, but with position: -webkit-sticky set on html worked for me the best.

    @media (orientation:landscape) {
        html.ipad.ios7 {
            position: -webkit-sticky;
            top: 0;
            width: 100%;
            height: 672px !important;
        }
    }
    

    Notice 'top: 0', not 'bottom: 0', and target element is 'html', not 'body'

提交回复
热议问题