第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使頁腳正確地粘在頁底

使頁腳正確地粘在頁底

慕標琳琳 2019-08-03 03:03:22
使頁腳正確地粘在頁底我試圖讓我的頁腳(只是一個div,其中有一行文本)在屏幕底部,如果內容沒有一直走到底部,或者在內容需要滾動條時位于內容的底部。如果內容不需要滾動條,它可以很好地工作,但是當內容太長時,頁腳仍然位于相同的位置,就在內容的頂部。我的基本部門結構是:<div id="container">     <div id="body"></div>     <div id="footer"></div></div>我相應的CSS(略為刪減):body {     margin: 0;     padding: 0;     height: 100%;}html {     margin: 0;     padding: 0;     height: 100%;}#container {     width: 674px;     min-height: 100%;     height: 100%;     position: relative;     margin: 0 auto;}#body {     width: 616px;     padding: 5px 14px 5px 14px;     margin: 0 auto;     padding-bottom: 20px;}#footer {     position: absolute;     bottom: 0;     width: 644px;     height: 20px;     margin: 0 auto;}
查看完整描述

3 回答

?
交互式愛情

TA貢獻1712條經驗 獲得超3個贊

最簡單的解決辦法是使用min-height<html>標記并定位<footer>帶著position:absolute;

演示: 小提琴所以片段:

html {
    position: relative;
    min-height: 100%;}body {
    margin: 0 0 100px;
    /* bottom = footer height */
    padding: 25px;}footer {
    background-color: orange;
    position: absolute;
    left: 0;
    bottom: 0;
    height: 100px;
    width: 100%;
    overflow: hidden;}
<article>
    <!-- or <div class="container">, etc. -->
    <h1>James Dean CSS Sticky Footer</h1>
    <p>Blah blah blah blah</p>
    <p>More blah blah blah</p></article><footer>
    <h1>Footer Content</h1></footer>




查看完整回答
反對 回復 2019-08-05
?
月關寶盒

TA貢獻1772條經驗 獲得超5個贊

為何不使用:{ position: fixed; bottom: 0 } ?

查看完整回答
反對 回復 2019-08-05
  • 3 回答
  • 0 關注
  • 288 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號