如何在移动视图中使导航中心的链接对齐? (Bootstrap 4)

时间:2017-11-16 19:35:19

标签: html twitter-bootstrap bootstrap-4

<nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
    <div class="container"> 
        <a href="#index.html" class="navbar-brand">Some title</a>
        <button class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="navbar-nav ml-auto">
                <li class="nav-item text-center">
                    <a href="#link1" class="nav-link ">link1</a>
                </li>
                <li class="nav-item text-center">
                    <a href="#link2" class="nav-link">Link2</a>
                </li>
                <li class="nav-item text-center">
                    <a href="#link3" class="nav-link">link3</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

在使用常规ol'Bootstrap 4时,默认情况下,在移动视图中,链接将在点击切换器图标后左对齐...我一直试图让它居中对齐但没有成功。有什么帮助?谢谢!

0 个答案:

没有答案