2
简而言之,我想通过iframe实现什么this website通过帧实现。这是怎么可能的CSS和没有JavaScript?如何将iframe扩展到没有javascript的文档高度?
简而言之,我想通过iframe实现什么this website通过帧实现。这是怎么可能的CSS和没有JavaScript?如何将iframe扩展到没有javascript的文档高度?
让我们假设你有下面的HTML:
<!doctype html>
<div>
<iframe src="http://www.example.com"></iframe>
</div>
<div>
<iframe src="http://www.example.org"></iframe>
</div>
现在,如果你想有(像你的榜样页)第一个iframe中有一个特定的高度和第二填充文档的其余部分,您可以使用表格中display
属性的值:
html {
height: 100%;
}
body {
display: table;
height: 100%;
width: 100%;
margin: 0;
}
div {
display: table-row;
}
div:first-child {
height: 100px;
}
div:last-child {
height: 100%;
}
iframe {
display: table-cell;
width: 100%;
height: 100%;
border: none;
}
这种方法对旧版浏览器(即IE6,7和8)有效吗?这是如何“未来证明”? – RLH 2012-11-02 14:18:49