强制图像在bootstrap固定页脚内部水平对齐电话分辨率

时间:2015-01-12 07:51:09

标签: html css twitter-bootstrap

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

<!-- 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

Phone Res。

enter image description here

如何解决?

1 个答案:

答案 0 :(得分:0)

添加bootstrap-floating css-class&#34; pull-left&#34;每个list-element都应该做到这一点,例如:

<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>