【问题标题】:why is my footer not sitting on the bottom为什么我的页脚不在底部
【发布时间】:2018-11-18 18:45:44
【问题描述】:

我不明白为什么我的页脚略高于网页底部而不是直接位于底部

h6 {
  font-family: Neue Haas Grotesk, sans-serif;
  font-weight: 300;
  font-size: 1.4vw;
  color: white;
  position: relative;
  display: block;
}

.footer {
  position: relative;
  display: inline;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin-bottom: 0;
  padding: 0;
}
<div class="footer">
  <h6>&copy; Alex Burger. All rights reserved<br>Further information can be requested through email.</h6>
</div>

【问题讨论】:

  • 你能用position:fixed代替relative吗?
  • 可能是因为您的 (h6) 标签,请尝试使用其他标签,例如 (p, div or span)
  • 添加您的完整代码
  • 您需要删除边距。给margin: 0

标签: html css


【解决方案1】:

&lt;h6&gt; 标签具有原生边距。因此,您的问题将通过以下方式解决:

.footer h6 {
  margin-bottom: 10px;
}

请注意,设置margin: 0px 并没有您期望的结果,这只能通过更改文档的其他部分来解决。

【讨论】:

    猜你喜欢
    • 2016-04-19
    • 1970-01-01
    • 1970-01-01
    • 2018-02-21
    • 1970-01-01
    • 2015-05-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多