【发布时间】:2019-06-01 03:20:08
【问题描述】:
我正在尝试将页脚设置在页面底部,并且我设法使用 CSS 属性“position:fixed”和“bottom:0”来做到这一点。 但是,通过这样做,我的两个页脚 DIV 之间不再有空格。 我一直在解决这个问题。
我的html:
<div class="footer">
<div class="footer-links">
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-facebook"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-linkedin"></i></a>
</div>
<div class="footer-copyright">
<%= link_to "Creato da: F & F", poetries_path =%>
</div>
</div>
我的 CSS:
.footer {
background: #F4F4F4;
display: flex;
align-items: center;
justify-content: space-between;
height: 100px;
padding: 0px 50px;
color: rgba(0,0,0,0.3);
position:fixed;
bottom:0;
}
.footer-links {
display: flex;
align-items: center;
}
.footer-links a {
color: black;
opacity: 0.15;
text-decoration: none;
font-size: 24px;
padding: 0px 10px;
}
.footer-links a:hover {
opacity: 1;
}
.footer .fa-heart {
color: #D23333;
}
基本上我想要页面左下角的 DIV footer-links 和右下角的 DIV footer-copyright。但是,即使我使用space-between,它们现在都在左下角
【问题讨论】: