Iframe creates extra space below

后端 未结 9 1270
無奈伤痛
無奈伤痛 2020-12-30 18:23

Why does an iframe add extra space under its element? Look at this weird behavior:

9条回答
  •  生来不讨喜
    2020-12-30 19:15

    The other answers worked for me when designing for just mobile or just desktop, but when the padding-bottom would have been different based on the size of the screen, it did not work.

    What does work is using Viewport Height.

    I added these to my CSS and it resolved the issue in all resolutions.

    .resp-iframe 
    {
        height: 100vh;
        min-height: 800px;
    }
    

提交回复
热议问题