首页 > > > html 中页脚的样式footer 底部对齐
添加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/ ,如需转载,请注明出处,否则将追究法律责任。