【发布时间】:2013-11-28 02:10:04
【问题描述】:
我有一个包含两行容器的容器(包装器),并且我将两行的高度值都设为自动,以便可以根据其中的内容动态调整其大小(而不是为每一行指定特定高度,例如行-顶部高度 46% 和行底部 54%)。我正在尝试获取底行容器的高度以使用 CSS 自动填充屏幕(*不使用 JavaScript)。请检查下面附加的图像以获得预期的结果。请指教,谢谢。
Click here for preview at JSfiddle
HTML
<div id="content-wrapper">
<div id="row-top">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</div>
<div id="row-bottom">
<iframe id="gmap"></iframe>
</div>
</div>
CSS
#content-wrapper {
display:block;
height:100%;
overflow-y: scroll;
width:600px;
float:left;
background-color:yellow;
}
#row-top {
color:#fff;
display:block;
position:relative;
width:100%;
height:auto;
background-color:blue;
}
#row-bottom {
display:block;
width:100%;
height:auto;
}
iframe#gmap {
overflow: hidden;
height:100%;
width: 100%
}
Click here for preview at JSfiddle
预期结果:
【问题讨论】:
标签: css row-height