gpt4 book ai didi

html - 强制 Bootstrap 固定页脚内的图像在手机分辨率上水平对齐

转载 作者:行者123 更新时间:2023-11-28 08:39:09 24 4
gpt4 key购买 nike

我试图让社交图片在手机上水平显示,它在更高的分辨率下工作正常,但是当我切换到手机分辨率时,图像垂直对齐并在内容上扩展页脚,这里是代码的样子:

<!-- Footer -->
<footer>
<nav id="top-nav" class="navbar navbar-inverse navbar-fixed-bottom custom-footer">
<div class="container ">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<img id="logo-fot" alt="BeBandSM" src="img/logo-fot.png">
</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><img class="social-media-img" src="img/facebook.png" alt=""></a></li>
<li><a href="#"><img class="social-media-img" src="img/google_plus.png" alt=""></a></li>
<li><a href="#"><img class="social-media-img" src="img/twitter.png" alt=""></a></li>
<li><a href="#"><img class="social-media-img" src="img/youtube.png" alt=""></a></li>
</ul>
</div>
</nav>
</footer>

CSS:

.custom-footer{
background-color: #000000;
}


.social-media-img {
width: 30px;
height: 30px;

}

结果:高分辨率。 enter image description here

电话分辨率

enter image description here

如何解决?

最佳答案

将 Bootstrap float css 类“pull-left”添加到每个列表元素应该可以解决问题,例如:

<ul class="nav navbar-nav navbar-right">
<li class="pull-left"><a href="#"><img class="social-media-img" src="img/facebook.png" alt=""></a></li>
<li class="pull-left"><a href="#"><img class="social-media-img" src="img/google_plus.png" alt=""></a></li>
<li class="pull-left"><a href="#"><img class="social-media-img" src="img/twitter.png" alt=""></a></li>
<li class="pull-left"><a href="#"><img class="social-media-img" src="img/youtube.png" alt=""></a></li>
</ul>

关于html - 强制 Bootstrap 固定页脚内的图像在手机分辨率上水平对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27897424/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com