這是頁腳如何保持頁腳下來
#footer {
position: absolute;
width: 100%;
height: 10%;
margin-top: 1%;
bottom: 0px;
top: 99%;
}
#copyright {
float: left;
font: normal normal normal 12px/1.3em Arial, 'ms pgothic', helvetica, sans-serif;
color: #616060;
margin-left: 15%;
}
#linkedin {
float: right;
margin-right: 15%;
color: #043551;
font: normal normal normal 20px Arial, 'ms pgothic', helvetica, sans-serif;
}
<div id="footer">
<div id="copyright">
© 2016 copmpany
</div>
<div id="linkedin">
Follow us on
<a href="https://www.linkedin.com/">
<img alt="LinkedIn" src="http://i.imgur.com/DqA6suH.png">
</a>
</div>
</div>
這是looks like如何。這應該如何呢look like。我不想使用position:absolute
,我想讓它在所有屏幕和網站的所有頁面上都能正常工作。如果我使用絕對的話,那麼當我使用手機時,它會下降太多。
我已經嘗試了一切,包括使用.container{ max-height:140%;}
並將頁腳99%的距離,但沒有工作,沒有任何工作。我無法使用固定位置,因爲在我鏈接到的服務頁面上,某些屏幕上的高度會達到130%。
'底部:0像素;頂部:auto;'或者爲什麼給頂部只使用'bottom'並且移除'top',還需要在主容器中添加'padding-bottom'來爲頁腳留出空間。 – vivekkupadhyay
取出'bottom:0px; '和'top:99%' – Relisora
你的css中有'html,body {height:100%}'。將其改爲'min-height'。你的包裝div打擊通過了100%,並造成問題。您還可以將頁腳設置爲「相對」。 「絕對」只適用於缺乏內容的情況,而不是。 –