【发布时间】:2013-07-09 13:15:39
【问题描述】:
请访问this fiddle 了解我的意思-
我有一个父 DIV,其中有两个垂直排列的 DIV。 顶部 DIV 应仅具有其内容的高度,而底部 DIV 应占据父 DIV 的所有剩余空间,与内容高度无关,也不应与父 DIV 重叠。
HTML:
<div class="outer">
<div class="inner-title">
THIS IS MY TITLE
</div>
<div class="inner-content">
CONTENT AREA
</div>
</div>
CSS:
html,body
{
height: 100%;
}
.outer
{
background-color:blue;
height: 80%;
}
.inner-title
{
background-color:red;
}
.inner-content
{
background-color:yellow;
height: auto;
}
简而言之,“inner-content”应该占据“outer”DIV的所有剩余空间,不重叠。
知道如何实现这一目标吗?
非常感谢任何帮助。
【问题讨论】: