基本上我有3格。顶部,中部,底部。 顶部有60px的高度; 底部有60px的高度; 我希望中间是Top和Bottom之间的高度。我尝试了height: 100%;
,但它似乎没有工作。Div高度:2格之间的100%
如果我设置的高度为.middle
它不会做任何事情。如果我决定放一个height : 10px;
或填充它会显示出于某种原因。
HTML代码:
html,
body{
height:100%;
\t background-color: #181818;
\t margin: 0 auto;
\t position: relative; \t
}
.nopadding {
\t padding: 0 !important;
\t margin: 0 !important;
}
.topbanner {
\t background-color: #282828;
\t display:block;
height: 76px;
}
.leftbanner {
\t background-color: #282828;
\t height: 100%;
}
.middlebanner {
\t background-color: #181818;
\t height: 100%;
\t
}
.rightbanner {
\t background-color: #282828;
\t height: 100%;
}
.bottombanner {
\t background-color:#282828;
\t height: 60px;
\t \t position: absolute;
\t width: 100%;
bottom: 0px;
left: 0;
}
.middle{
\t height: 100%;
}
.row {
}
<div class="container-fluid">
\t \t <div class="top" id="header">
\t \t \t <div class="row">
\t \t \t \t <div class="topbanner">
\t \t \t \t
\t \t \t \t </div>
\t \t \t </div>
\t \t </div>
\t \t <div class="middle" id="middle">
\t \t \t <div class="row">
\t \t \t \t <div class="col-md-2 nopadding">
\t \t \t \t \t <div class="leftbanner">
\t \t
\t \t \t \t \t </div>
\t \t \t \t </div>
\t \t \t \t
\t \t \t \t <div class="col-md-8 nopadding">
\t \t \t \t \t <div class="middlebanner">
\t \t \t \t \t
\t \t \t \t \t </div>
\t \t \t \t </div>
\t \t \t \t
\t \t \t \t <div class="col-md-2 nopadding">
\t \t \t \t \t <div class="rightbanner">
\t \t \t \t \t
\t \t \t \t \t </div>
\t \t \t \t </div>
\t \t \t </div>
\t \t </div>
\t \t
\t \t <div class="bottom" id="footer">
\t \t \t <div class="row">
\t \t \t \t <div class="bottombanner">
\t \t \t
\t \t \t \t </div>
\t \t \t </div>
\t \t </div>
\t </div>
[html5:固定顶部/底部和可滚动中间的三行flexbox的可能的重复](http://stackoverflow.com/questions/19477707/html5-thre e-rows-flexbox-with-fixed-top-bottom-and-scrollable-middle) –
请不要使用答案中的代码更新您的问题。 – nicael
请不要这样做,问题应该只显示***原来的问题***。 – nicael