How can I dynamically change the height of an iFrame?

My parent div has a min-height of 100%.  An inner div with a position absolute has a min-height of 100%. When more content is added to the inner height, the parent height does not change?

  • Answer:

    Element positioned with absolute is taken out of the normal flow, that's why it won't change it's parent's height.

Yujun Wu at Quora Visit the source

Was this solution helpful to you?

Other answers

The child element is no longer relative to the parent element since it is no longer part of the document flow. When you declare absolute positioning for an element, this is what happens. The element in question is removed from the document flow, or the structure of the html, even though the DOM itself remains unaltered. It becomes relative to the window if no parent element higher up in the document model has been explicitly declared as relative.It's as though the child element has been removed from the parent element, leaving it empty. When the height or width of the child element increases, it doesn't affect the height or width of the parent element, and the flow of preceding and following elements remains unchanged.The child element becomes a ghost that can pass through the box model of the parent element, without affecting its proportions. You can constrain the absolute positioned child by explicitly declaring relative positioning to a parent element - this way, the absolute positioned child won't pass the parent element's dimensions, this is particularly useful for aligning elements declared with absolute positioning.

Nathan George Jean Shepherd

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.