[英]Footer div not keeping itself at bottom
紅色頁腳在中間上升。 如何讓它保持在底部? 像clear: both
和overflow: hidden
。
我已經嘗試了很多東西,是不是我做錯了什么?
代碼太大,無法粘貼在這里(30000 個字符限制)。 請把工作小提琴發給我。
更新:現在可以使用了。
#footer {
position: relative;
height: 274px
bottom: 0;
margin-top: 274px;
}
你有
#footer {
margin:-274px 0 0;
}
這使它具有負的上邊距並向上移動頁腳。 嘗試刪除該行。 雖然您可能還需要調整頁面的內容。 您應該在內容上使用 clearfix,這樣它就不會落后於頁腳。
試試這個 :
#footer { position:fixed; bottom:0; }
clear: both
對position: absolute
元素無效,因為它們超出了正常流程。position: absolute; bottom: 0;
position: absolute; bottom: 0;
div.gallery
元素上的div.gallery
,它將位於其容器的底部。 但這對您來說還不夠,您還應該將<div class="gallery">
移出其容器 div。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.