热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

为什么页脚位于页面中心?

页脚空间位于页面中间,内页以及移动和桌面视图中。请参考内页。网站:

页脚空间位于页面中间,内页以及移动和桌面视图中。请参考内页。
网站:http://psikologecealbayrak.com

/* 10.0 ===== Footer ===== */
/* -- "Footer" section (These are the styles for the Footer section) -- */
.site-footer {
padding: 30px 0 0px;
}
.footer-branding:hover img {
opacity: 0.5;
transition: all 0.3s ease 0s;
-webkit-transition: all 0.3s ease 0s;
-moz-transition: all 0.3s ease 0s;
-ms-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
}
.footer-branding {
margin-bottom: 15px;
}
.site-footer .widget-area {
clear: both;
padding: 75px 0 30px;
position: relative;
}
.widget-area .widget {
margin: 0 0 30px;
}
.widget-area .inline-social-icons{
padding-bottom: 20px;
text-align: center;
}



您可以尝试将页脚放置在页面底部的绝对位置。
将此添加到您的CSS

body{
padding-bottom: 60px;
}
.site-footer{
position: absolute;
bottom: 0;
}

,

尝试一下

footer{
position: absolute;
right: 0;
bottom:0;
left:0;
background-color: black;
color: #fff;
padding:10px;
font-size:16px;
text-align: center;
margin-top:0px ;
}
body {
position: relative;
min-height: 100vh;
}


推荐阅读
author-avatar
纯洁的老宁同志
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有