html - 即使定义了边距等,页脚也不会到达边缘?
问题描述
我在这里开始感到疯狂。即使已定义,我的页脚也不会到达窗口边缘(至少我是这么认为的)
.footer {
height: 200px;
bottom: 0px;
margin: 0px;
left: 0px;
right: 0px;
padding: 0px;
width: 100%;
background-color: #E5E5E5;
text-align: center;
}
<footer>
<div class="footer">
<p>Footer</p>
</div>
</footer>
解决方案
我从 html 和 body 标签中删除了边距
html,body{
margin:0;
}
.footer {
height: 200px;
bottom: 0px;
margin: 0px;
left:0px;
right:0px;
padding: 0px;
width: 100%;
background-color: #E5E5E5;
text-align: center;
}
<footer>
<div class="footer">
<p>Footer</p>
</div>
</footer>
推荐阅读
- nginx - Logstash 错误:代理 - 无法执行操作
- r - R中的自动化(循环)欧几里得距离测量
- swift - 如何使用 UISwitch 从数据数组中添加和删除数据
- amazon-web-services - 使用 API 调用 CreateTrail 操作时出现 InsufficientS3BucketPolicyException
- google-analytics - 谷歌分析 4 点击数据
- python - 打印/写入 x 和 y 坐标时,数字 > 9 不匹配
- python - 在 python 中使用 mediainfo 提取电影名称
- html - 将表属性应用于具有固定页眉和页脚的 asp.net GridView
- mysql - 忽略具有相同名称的订单 ID 的第一个订单
- php - Laravel,只有传递给路由的数组的第一个元素是可读的