html - 我的页脚的一大块从页面上消失了
问题描述
全屏时我的页脚在右侧增加了空间,当我使用例如移动视图时,我的页脚的一部分消失了。我只是希望它停留在底部而不涵盖任何内容。即使它缩小到移动视图。
[![De red line is the extra space im talking about][1]][1]
#footer {
position: absolute;
left: 0;
bottom: 0 !important;
width: 100%;
height: 2.5rem;
padding-right: 0;
background-color: black;
border-top: 4px solid #F2D380;
overflow: auto;
}
#footer a {
color: white;
text-decoration: none;
}
<div id="footer">
<div class="row text-center justify-content-center">
<div class="col-lg-2 ">
<a href="#"> Company Information </a>
</div>
<div class="col-lg-2">
<a href="#"> Privacy Policy and User Agreement </a>
</div>
<div class="col-lg-2">
<a href="about.html"> About </a>
</div>
<div class="col-lg-2">
<a href="about.html"> ©2019 Copyright claim </a>
</div>
<div class="col-lg-2">
<a href="#">
<img src="images/linkedin.png" class=" socialIcon">
</a>
<a href="#">
<img src="images/instagram.png" class=" socialIcon">
</a>
<a href="#">
<img src="images/facebook.png" class=" socialIcon">
</a>
<a href="#">
<img src="images/youtube.png" class="socialIcon">
</a>
</div>
</div>
</div>
解决方案
所以为什么要添加空间并覆盖内容的问题是因为绝对定位。如果您不希望它涵盖内容,您有几个选择。将内容包装器设置为设定的高度,将页脚设置为该高度的其余部分,以便页脚在底部保持可见并且不会覆盖内容。
如果您只是希望它充当页脚并位于移动设备的底部,我只需将其设置为相对位置即可。
如果没有页面上的其他内容,很难想象您的目标是什么。
推荐阅读
- java - 如何从 postgresql 数组类型中获取整数数据
- security - node_modules 中的潜在威胁
- next.js - Nextjs 使用 fetch 代理多部分表单数据
- java - 为什么其中一种方法适用于 ImageView 的 Shring Image?
- pytorch - 将maddpg应用于particalenv时添加噪声的方法
- android - 是 Jetpack compose 中的 animate*AsState 动画
- sql - 如何在 sql 中轻松地将 139.29.0.0 转换为 139.029.000.000?
- r - 在 R 中将 API 密钥与 Gender 包一起使用
- python - Python 包找不到 libboost_python36.so.1.67.0
- c# - 从 View 传递到 Controller 的列表变为 null