0
如下圖所示,身體上有浮動元素的div,但全部清除。爲什麼身體不是用內部元素擴展的?
守則(https://jsfiddle.net/4ke0cxg7/2/):
html, body {
height: 100%;
}
body {
background: grey;
}
#foot {
position: absolute;
bottom: 0;
background: white;
font-size: 16px;
font-weight: bold;
}
#h {
margin-bottom: 20px;
}
#wrapper {
margin-bottom: 30px;
}
<body>
<div id="wrapper">
<div class="container-fluid">
<div class="row-fluid">
<div class="span9">
<div class="card card-small">
<div class="card-heading simple">
Phone Book
</div>
<div class="card-body">
<!-- I have other tabs here -->
<div class="tab-content">
<div class="active tab-pane" id="columns">
<table class="table table-striped table-condensed sampleTable">
<thead>
<tr>
<th> </th>
<th>Name</th>
<th>State</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td title="Scroll to the column">
<a href="javascript:void(0)" data-row-selector="true" class="column-selector">John</a>
</td>
<td>NY</td>
<td></td>
</tr>
<!-- Snipped for conciseness -->
<tr>
<td>21</td>
<td title="Scroll to the column">
<a href="javascript:void(0)" data-row-selector="true" class="column-selector">Rambo</a>
</td>
<td>NY</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
Footer
</div>
</body>
頁腳掛在頁面中間。爲什麼不擴展到包含#wrapper
div?
更新:我可以改變任何風格,除了頁腳(它由其他人控制)。爲什麼身體不能展開以包含div?
替換'的位置是:絕對的;'和'位置:relative':https://jsfiddle.net/4ke0cxg7/3/?? –
我看不到問題,但如果您無法控制CSS,則無法修復CSS問題。 – Rob
@Rob - 你在jsFiddle上看不到問題嗎?頁腳粘貼到窗口的底部而不是頁面。嘗試減少預覽窗格的垂直大小... https://jsfiddle.net/4ke0cxg7/4/ – questions