Reputation: 929
I have an iframe inside of a table cell, roughly:
<table>
<tr>
<td>
<iframe style=height:100%; width:100% src="content.aspx" />
</td>
<tr>
</table>
When the page initially loads everything sizes correctly, the iframe expands to the full area of the cell. If you reload the content of the cell of perform a submit, the iframe collapses, presumably because it thinks there is no content, but then does not re-expand once the content does load.
Can this be prevented? iframe height = 100% always...
**Update: This is my actual iframe:
<iframe id="frmContent" runat="server" frameborder="0" src="Home.aspx" style="height:100%; width:100%; margin:0; padding:0; display:block" >
I discovered the problem is the display: block, but if I don't use that the iframe renders extra space underneath it that ruins my layout causing an extra scroll bar.
Upvotes: 1
Views: 1741
Reputation: 287940
Some problems:
height: 100%
only works in elements that can't increase parent's height, that is, those out of the normal flow of the document (absolute or fixed positioned), or those whose parent has a given height (not auto).Upvotes: 1