html - 页脚问题 CSS
问题描述
我目前正在制作我的第一个网站,但我的页脚有问题。我使用的是固定页脚,但是一旦我开始缩小到移动设备,页脚就会覆盖内容。关于如何解决这个问题有什么建议吗?这是我的代码:
这是我的标记:
footer {
clear: both;
position: fixed;
bottom: 0;
width: 100%;
height: 50px;
background-color: rgba(48, 57, 148, 0.8);
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
<footer>
<div class="socialmedia">
<a href="https://www.linkedin.com/in/andrea-de-roeck-b6b47164/"><span class="hidden">Linkedin</span><span class="fab fa-linkedin" aria-hidden="true"></span></a>
<a href="https://www.instagram.com/dreaderoeck/"><span class="hidden">Instagram</span><span class="fab fa-instagram" aria-hidden="true"></span></a>
<a href="mailto:deroeck.andrea@gmail.com"><span class="hidden">Email</span><span class="fas fa-envelope-square" aria-hidden="true"></span></a>
</div>
</footer>
任何建议将不胜感激谢谢:)
解决方案
给出一个等于页脚高度的最小填充底部主体。
body {
padding-bottom: 50px;
}
推荐阅读
- c++ - 拣货问题(自定义 unProject() 函数)
- jsonata - 如果数组包含特定字符串,则返回 True - JSONata
- sql - 如何在 SQL / Snowflake 中创建列和行相同的交叉表/系数表?
- java - 需要检索触发地理围栏中心的经纬度,但Hash-Map返回null
- .net-core - Hangfire Autofac .net 核心 3.1
- javascript - 我在父节点之上添加节点,然后尝试运行布局
- javascript - 如何构建一个应用程序,让用户填写一个可以下载或通过电子邮件发送为 PDF 的表单?
- sql - OBIEE 表达式按上一个营业日期过滤
- javascript - 有人可以帮助我,并修复我的 javascript 中的动画问题吗?
- python - 有没有相对简单的卷积神经网络架构用于音频去噪?