iframe size with CSS on iOS

前端 未结 4 1454
旧巷少年郎
旧巷少年郎 2020-11-27 20:29

There\'s an iframe, which basically has more content than fits into the frame. The sizing of the frame is based on the browser screen size and lets the overflow scroll, whic

4条回答
  •  一整个雨季
    2020-11-27 21:06

    This is an old question, but since it comes first on google and the issue exists on nowadays ios devices, I repost a better fix that I found on this page: How to get an IFrame to be responsive in iOS Safari?

    Basically, if you have an iframe with scroll (let's say a twitter widget), the solution above won't work very well because it makes the parent scrollable. The fix that worked for me is replacing height: 100% with height: 1px; min-height: 100%;.

提交回复
热议问题