-3
<div class="header">logo</div>
<div class="some-content">some content</div>
<div class="footer">Footer here</div>
與類名「一些內容」一個div,如果有更多的內容腳註是在窗口的底部可見,但如果內容少,頁腳跳到內容塊結束的地方,如何解決這個問題。
<div class="header">logo</div>
<div class="some-content">some content</div>
<div class="footer">Footer here</div>
與類名「一些內容」一個div,如果有更多的內容腳註是在窗口的底部可見,但如果內容少,頁腳跳到內容塊結束的地方,如何解決這個問題。
我不能正確理解的問題,但如果你想頁腳在固定位置,即是永遠,瀏覽器的底部,那麼你可以使用下面的造型
<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>
這就是你需要做的..檢查意見
/**** 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>
谷歌爲 「粘頁腳」。 – Vucko
^^^^^^^^^^^^^^^ – BFWebAdmin
發佈你的CSS,讓它知道你試圖讓你的頁腳「在窗口底部可見」。 – Phani