-2
當我嘗試修復頁腳底部,修復頁腳在頁面
#footer{
position:fixed;
bottom:0;
}
我修復頁腳在底部,但始終保持在屏幕的底部,怎麼可以固定在上述內容的底部,使它可以調整大小的內容?
當我嘗試修復頁腳底部,修復頁腳在頁面
#footer{
position:fixed;
bottom:0;
}
我修復頁腳在底部,但始終保持在屏幕的底部,怎麼可以固定在上述內容的底部,使它可以調整大小的內容?
position:fixed
是相對於窗口。您需要將其更改爲position: absolute
如果你想顯示在窗口同時內容和頁腳具有position:relative
一個div容器裏面,你可以使用overflow-y:scroll
,你可以修復在頁面底部的頁腳使用**position:fixed;**
html,body{
width:100%;height:100%;
}
div{
width:100%;
background-color:red;
height:80%;
overflow-y: scroll;
}
footer{
width:100%;
position:fixed;
bottom:0;
background-color:yellow;
height:20%;
}
<div id="content">
afsal khan added user andaman naveen on Nov 21st U added user afsal khan on Nov 7th D deleted User afsal on Nov 7th U added user afsal on Friday U added user afsal on Thursday L afsal khan added a new Template 'Flatkit' on Thursday L afsal khan added a new Template 'Elite Green' on Thursday L afsal khan added a new Template 'Elite Blue' on Thursday U afsal khan added user dsaaa on Tuesday U added user afsal khan on Oct 28th more afsal khan added user andaman naveen on Nov 21st U added user afsal khan on Nov 7th D deleted User afsal on Nov 7th U added user afsal on Friday U added user afsal on Thursday L afsal khan added a new Template 'Flatkit' on Thursday L afsal khan added a new Template 'Elite Green' on Thursday L afsal khan added a new Template 'Elite Blue' on Thursday U afsal khan added user dsaaa on Tuesday U added user afsal khan on Oct 28th more afsal khan added user andaman naveen on Nov 21st U added user afsal khan on Nov 7th D deleted User afsal on Nov 7th U added user afsal on Friday U added user afsal on Thursday L afsal khan added a new Template 'Flatkit' on Thursday L afsal khan added a new Template 'Elite Green' on Thursday L afsal khan added a new Template 'Elite Blue' on Thursday U afsal khan added user dsaaa on Tuesday U added user afsal khan on Oct 28th more
afsal khan added user andaman naveen on Nov 21st U added user afsal khan on Nov 7th D deleted User afsal on Nov 7th U added user afsal on Friday U added user afsal on Thursday L afsal khan added a new Template 'Flatkit' on Thursday L afsal khan added a new Template 'Elite Green' on Thursday L afsal khan added a new Template 'Elite Blue' on Thursday U afsal khan added user dsaaa on Tuesday U added user afsal khan on Oct 28th more
</div>
<footer>footer here</footer>
我不知道你想調整它哪些內容。你能發佈一個更完整的例子嗎? –
這是css 101的東西 –
您已經足夠長的時間瞭解Stack如何用解決方案標記問題並解決問題,並且您擁有很多 –