why does CSS background-size: cover not work in portrait mode on iOS?

后端 未结 5 647
礼貌的吻别
礼貌的吻别 2020-12-28 09:16

I\'m trying to set up a manualy splash-image across devices. I\'m doing so by checking for orientation (touch devices) or screen width vs. sc

5条回答
  •  自闭症患者
    2020-12-28 09:53

    According to Designing Websites for iPhone X iOS 11 introduces a new extension for the existing viewport meta tag called viewport-fit, which provides control over the insetting behavior. The default setting is auto, which will not cover the entire screen.

    In order to disable the default inset behavior and cause the page to lay out to the full size of the screen, you can set viewport-fit to cover as shown here:

    
    

    Without this setting existing techniques used for splash screens and full-size hero images may not display as expected on the iPhone X or other conformant iOS devices.

提交回复
热议问题