【发布时间】:2018-11-14 09:05:13
【问题描述】:
我浏览了许多不同的帖子,但似乎没有一个好的、有效的解决方案。我希望我的页脚位于页面底部,无论是在台式机的显示器上还是在 Safari 中的 iPhone 上查看网站。
当前css代码:
body {
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
line-height: 60px;
background-color: #f5f5f5;
}
HTML 代码:
<footer class="footer">
<div class="container">
<span class="text-muted">text</span>
</div>
</footer>
页脚目前在桌面版页面底部,在移动版 Safari 中位于页面中间。
【问题讨论】:
标签: css mobile-safari sticky-footer