我需要在頁面上放置粘性頁腳,但是我沒有爲頁腳設置一個確定的高度。在較小的屏幕上 - 行的大小調整和頁腳變長。Bootstrap 4 - 粘性頁腳 - 動態頁腳高度
因此,getbootstrap上提供的默認粘性頁腳示例不起作用,因爲它需要固定的頁腳高度。
任何方式來實現這個?
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
background-color: #f5f5f5;
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
body > .container {
padding: 60px 15px 0;
}
.footer > .container {
padding-right: 15px;
padding-left: 15px;
}
code {
font-size: 80%;
}
的可能的複製[如何使流體粘性頁腳](https://stackoverflow.com/questions/16901707/how-to-make-a-fluid-sticky-footer) –