[英]how to decrease the height of the footer while keeping the text inside centered
This is my css code I tried using padding, margin and a few other things to decrease the size height but it did not work but all of them would either move the footer out of the bottom completely or leave the text uncentered.这是我的 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;
}
This is my HTML code这是我的 HTML 代码
<footer>
<section>
<h2> ❤️ Made with love by Run Buddy</h2>
<div>
<a href="#">Read Our Privacy Policy</a><br/>
© 2019 Run Buddy, Inc.
</div>
</section>
</footer>
HTML: HTML:
<footer>
<h2> ❤️ Made with love by Run Buddy</h2>
<div>
<a href="#">Read Our Privacy Policy</a><br/>
© 2019 Run Buddy, Inc.
</div>
CSS: 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;
}
You can give whatever value you want to the height value in the footer.您可以为页脚中的高度值提供您想要的任何值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.