CSS页脚后面有少量空格

CSS页脚后面有少量空格,css,footer,Css,Footer,我在删除页脚后的空白时遇到问题。我可以在chrome设置了一个空白的底部来删除它,但这在Firefox或IE上不起作用。我不太清楚为什么会有空白 感谢您的帮助 <div class="footer"> <section class="footer-inner"> <p class="footer-text">Copyright</p> </section> </div> .footer { height

我在删除页脚后的空白时遇到问题。我可以在chrome设置了一个空白的底部来删除它,但这在Firefox或IE上不起作用。我不太清楚为什么会有空白

感谢您的帮助

<div class="footer">
  <section class="footer-inner">
    <p class="footer-text">Copyright</p>
  </section>
</div>

.footer {
  height: 300px;
}
.footer-inner {
  margin-top: -10px;
  background-color: #E0E6E6;
}
.footer-text {
  padding: 100px 0;
  text-align: center;
}

版权所有

.页脚{ 高度:300px; } .页脚内侧{ 利润上限:-10px; 背景色:#E0E6E6; } .页脚文本{ 填充:100px0; 文本对齐:居中; }

或者

您的页脚当前是一个p类,它正在页脚上创建一个底部边距:

p {
    margin: 0 0 10px;
}
将页脚从段落更改为div,如下所示:

<div class="footer-text">
    Copyright &copy; 2015 etc...
</div>

版权及副本;2015年等等。。。

因为引导将在p元素中添加边距, 在中设置页边距底部。页脚文本应起作用

.footer-text {
  padding: 100px 0;
  text-align: center;
  margin-bottom: 0;
}

哇!谢谢bootstrap。这确实解决了问题,也是罪魁祸首,所以我应该这样解决。