Why does `position:fixed` not work when viewed in an `iframe` using an iPhone or iOS device?

前端 未结 1 533
盖世英雄少女心
盖世英雄少女心 2021-02-07 10:10

I\'ve looked into stackoverflow and it seems that position:fixed in an iframe for iOS mobile devices has been an issue in the past but have yet to have an answer.

Here\'

相关标签:
1条回答
  • 2021-02-07 10:57

    In Chrome and Safari on iOS it seems the issue here is not the fixed position, but with the height of the iframe. From another SO answer: "Starting in version 4.2.1 of Safari iOS, and still going as of 4.3.3, the entire content of an iFrame is forcibly shown."

    These other posts might help you:

    • iframe on iOS (iPad) content cropping issue - https://stackoverflow.com/a/10816492/1359306
    • iFrame and Mobile Safari (iPad/iPhone) - https://stackoverflow.com/a/19667786/1359306
    0 讨论(0)
提交回复
热议问题