基本上我有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