在IE10中,Iframe不会根据其父级调整其Precentage(%)宽度和高度

时间:2013-05-17 11:56:18

标签: html css internet-explorer-10

有趣的是,我在这个例子中通过制动一个非常小的部分并发现了问题。

在IE10中,如果<iframe>中存在<td>,则以百分比给出的Iframe的高度宽度属性不会过多地考虑其父级的高度宽度。

如下例所示,id为'test'的iFrame采用height width = 100%。而它的父母的身高是1px。 当你在IE10中运行时,框架看起来高度非常大并且显示出异常行为

<BODY id="WESWinDesktop">
<table id=WESStructure width="100%" height="100%" border="2" cellpadding="0" cellspacing="0">
    <tr>
        <td id="WESMainWinTitleBarCont" height="1px">this is 'td' for iframe
            <iframe  id="test" src="" frameborder="0" width="100%" height="100%" scrolling="no"></iframe>
        </td>
    </tr>
    <tr>
        <td id="WESMainWinMenuBar" height="20">menu bar
        </td>
    </tr>
    <tr>
        <td height="100%" >content
        </td>
    </tr>
    <tr>
        <td id="WESMainWinStatus" height="20">status bar
        </td>
    </tr>
</table>
</BODY>

我通过放置<div>而不是<td>尝试了相同的操作,但行为是相同的。所以我想有一些错误IE10解释了iframe的宽度高度属性。

0 个答案:

没有答案