【发布时间】:2022-02-02 06:08:19
【问题描述】:
我有一个如下所示的页脚,它显示在所有页面上,我希望该页脚保持在网页内容的底部,并且如果内容没有超出视口的高度,我希望该页脚保持不变在视口的底部。我如何做到这一点?
如果我可以使它与类似手机的视口兼容或不搞混,那就太好了
我也不希望固定位置,因为这只会导致页脚在我滚动时停留在屏幕底部。
#footer {
width: 100vw;
min-height: 15vh;
background-color: var(--blue-black);
color: white;
display: table;
}
<div id="footer">
<div id="footer-content-table">
<div class="footer-box contact-us">
<div class="footer-box-title">
Contact Us
</div>
<div id="footer-contacts-list">
<a class="footer-contact" href="www.secretish.com">
<img src="/logo" alt="Our logo">
</a>
</div>
</div>
<div class="footer-box other-links">
<div class="footer-box-title">
Other Links
</div>
<div id="footer-links-list">
<a href="/about" class="footer-link">About Us</a>
<a href="/report" class="footer-link">Report a Problem</a>
</div>
</div>
</div>
<div id="footer-credit">Powered by bleep of bleep</div>
</div>
【问题讨论】:
-
这更接近于修复,除了适合视口高度的页面 - 它仍然保持在页面中心而不是绝对底部。不过我会尝试解决这个问题
标签: html css media-queries