簡體   English   中英

如何在保持文本居中的同時降低頁腳的高度

[英]how to decrease the height of the footer while keeping the text inside centered

這是我的 css 代碼我嘗試使用填充、邊距和其他一些東西來減小尺寸高度,但它沒有用,但它們都會將頁腳完全移出底部或使文本不居中。

footer {
  background: #fce138;
  width: 100%;
  padding: -100px 0;
}

footer h2 {
  display: inline;
  color: #024e76;
  font-size: 30px;
  margin: 0;
}

footer div {
  float: right;
  line-height: 1.5;
  text-align: right;
}

footer a {
  color: #024e76;
}

這是我的 HTML 代碼

<footer>
    <section>
    <h2> ❤️ Made with love by Run Buddy</h2>
    <div>
      <a href="#">Read Our Privacy Policy</a><br/>
      &copy; 2019 Run Buddy, Inc.
    </div>
  </section>
</footer>

頁腳圖片

HTML:

<footer>
<h2> ❤️ Made with love by Run Buddy</h2>
<div>
  <a href="#">Read Our Privacy Policy</a><br/>
  &copy; 2019 Run Buddy, Inc.
</div>

CSS:

footer {
  background: #fce138;
  width: 100%;
  height:200px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

footer h2 {
  display: inline;
  color: #024e76;
  font-size: 30px;
  margin: 0;
}

footer div {
  float: right;
  line-height: 1.5;
  margin-right:10px;
  text-align: right;
}

footer a {
  color: #024e76;
}

您可以為頁腳中的高度值提供您想要的任何值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM