#1
  1. A Change of Season
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,558
    Rep Power
    221

    Setting the right height for Iframe inside a div, and the parent div.


    Hello;

    I have a code that dynamically loads iframes in div.

    So here on this page, I embedded 4 common scenarios: https://webmoosh.com/broadcast.html

    Since the content is different, they could all have different heights.

    For some reason, it adds extra height in some situations.

    In the example, The top fixed one is ok, however, the other 3 have issues.

    The timer with blue font and the one with white font have some extra gap under.

    And the bottom fixed one has extra height on iPhone.

    What are the right ways of doing this do the height of the div containing the iframe, and the iframe itself be correct?

    I've done everything by the book.

    Thanks
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Location
    UK
    Posts
    2
    Rep Power
    0
    Hey there,

    Have you tried setting:

    Code:
    height: auto;
    overflow: hidden;
    on the Parent div?

    Kind regards,

IMN logo majestic logo threadwatch logo seochat tools logo