[英]Have a footer that sit on the bottom of the page with a fixed header
默認模型是內容框 ,為height:100%;
的元素添加padding-top
height:100%;
將使其高度100% + 130px
。
所以你必須添加另一個帶有自動高度的<div>
包裝器並添加它padding-top: 130px;
<html style="height:100%;">
<body style="height:100%; margin:0; position:relative;">
<div id="wrapper" style="min-height:100%;">
<div id="container" style="padding-top:130px; padding-bottom:130px;">
</div>
</div>
<div id="footer" style="position:absolute; bottom:0; height:130px;">
</div>
</body>
</html>
嘗試添加margin-top:-130px;
到您的頁腳容器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.