2015-11-05 17 views
-3

HTML如何讓頁腳可見,在窗口的底部,如果含量較少

<div class="header">logo</div> 
<div class="some-content">some content</div> 
<div class="footer">Footer here</div> 

與類名「一些內容」一個div,如果有更多的內容腳註是在窗口的底部可見,但如果內容少,頁腳跳到內容塊結束的地方,如何解決這個問題。

+1

谷歌爲 「粘頁腳」。 – Vucko

+0

^^^^^^^^^^^^^^^ – BFWebAdmin

+0

發佈你的CSS,讓它知道你試圖讓你的頁腳「在窗口底部可見」。 – Phani

回答

0

我不能正確理解的問題,但如果你想頁腳在固定位置,即是永遠,瀏覽器的底部,那麼你可以使用下面的造型

<div class="header">logo</div> 
<div class="some-content">some content</div> 
<div class="footer" style="position:absolute;top:95%;width:100%;background-color:orange;">Footer here</div> 
0

這就是你需要做的..檢查意見

/**** required CSS ***/ 
 

 
* { 
 
    box-sizing: border-box 
 
} 
 
/* browser reset */ 
 

 
html { 
 
    min-height: 100%; 
 
    position: relative; 
 
    padding-bottom: 50px; 
 
    /* height of footer */ 
 
} 
 
body { 
 
    height: 100%: 
 
} 
 
/* height of footer */ 
 

 
footer { 
 
    position: absolute; 
 
    width: 100%; 
 
    left: 0; 
 
    right: 0; 
 
    bottom: 0; 
 
    height: 50px; 
 
} 
 
/* DEMO Styling */ 
 

 
footer { 
 
    background: green; 
 
    color: #fff; 
 
    text-align: center; 
 
    line-height: 50px; 
 
}
<html> 
 

 
<body> 
 
    soemthing which doesn't covers whole page 
 
    <footer>copyright and I stay at bottoms always</footer> 
 
</body>

相關問題