我想創建一個網頁,其底部有一個固定的部分,頂部是一個將與內容動態填充的部分,這個動態部分應該有一個滾動條如果添加的內容不適合,以保持在固定部分之上。防止一個div重疊在一個固定的
的style.css:
.action-box{
position: fixed;
bottom: 15px;
margin-top: 10px;
width: 100%;
}
的index.html:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<!-- this will be filled with content -->
</div>
<div class="action-box">
<!-- this is the fixed part -->
</div>
</body>
</html>
可以在this fiddle兩個div
小號重疊見。
我怎樣才能使第一個div
可滾動,以便它不會滑過最後的div
或以下?
使用此解決方案我擺脫了固定的div:D謝謝! – Paul 2012-08-12 18:40:23
@保羅很高興聽到它。 :) – 2012-08-12 20:00:06