ITPub博客

首页 > > > html 中页脚的样式footer 底部对齐

html 中页脚的样式footer 底部对齐

作者:nt1979 时间:2019-08-28 11:35:57 0 删除 编辑

添加style

<style type="text/css">
 html {
 position: relative;
 min-height: 100%;
 }
 body {
 margin-bottom: 60px;
 }
 .footer {
 position: absolute;
 bottom: 0; width: 100%;
 /* Set the fixed height of the footer here */
 height: 60px;
 background-color: #f5f5f5;
 }
</style>
.......
.....
</div>
<footer class="footer">
 <div style="text-align:center;">
 Copyright 2019 by Ben
 </div>
</footer>
</body>

image.png

效果图,不管窗口放大还是调小,footer 都会 显示在最底也,也不会覆盖content 里面的内容。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4822/viewspace-3146028/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-05

  • 博文量
    318
  • 访问量
    17316