【发布时间】:2020-12-27 20:37:26
【问题描述】:
我对此非常陌生,并且使用 HTML 和 CSS 构建了我的第一个网页。我一直在使用 Bootstrap 4.5 框架。我试图让我的页脚与社交媒体图标保持在底部(文本下方)并保持居中。我希望它保持在底部,甚至超过视口。
我尝试过:使用 flexbox 和 justify-content-center,在 CSS 本身中尝试了 text-align center,还尝试添加一个 id 以使其更具体,但不确定我对这种情况下的特异性的理解是否是正确的。不胜感激,代码如下。
HTML:
<div class="footer">
<span id="bottom">
<hr>
<p>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-facebook"></i></a>
</p>
</span>
</div>
CSS:
i {
margin: 5px;
color: #FFE10E;
}
.footer {
position: absolute;
bottom: 0;
text-align: center;
}
#bottom {
text-align: center;
}
【问题讨论】:
-
到底是什么问题?页脚没有正确定位在底部还是它(或内容)没有居中?还是两者兼而有之?
标签: html css bootstrap-4