Bootstrap徽标与移动设备上的Navbar不对齐

时间:2018-11-19 20:17:52

标签: bootstrap-4 navbar

以下是我当前导航栏的屏幕截图:https://i.gyazo.com/374a580912788822e83809aa1ed501d3.png

徽标与导航栏折叠按钮不对齐。

这是我的引导程序代码:

<!--Nav start-->
<nav class="navbar navbar-expand-lg theme-nav fixed-top">
    <div class="container">
      <div class="navbar-brand">
         <a href="index.html"><img src="../assets/images/logo9.svg" alt="logo"></a>
           <button style="margin-left:10%;" class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainmenu" aria-expanded="false" aria-label="Toggle navigation">
               <span class="navbar-toggler-icon"><i class="fa fa-align-justify" aria-hidden="true"></i></span>
           </button>
        </div>
        <div class="collapse navbar-collapse" id="mainmenu">
            <ul class="navbar-nav ml-auto" id="mymenu">
                <li class="nav-item ">
                    <a class="nav-link" href="#about" >How it Works</a>
                </li>
                <li class="nav-item ">
                    <a class="nav-link" href="#package" >Pricing</a>
                </li>
                <li class="nav-item ">
                    <a class="nav-link" href="#faq" >FAQ</a>
                </li>
                <li class="nav-item ">
                    <a class="nav-link" href="#about" >How it Works</a>
                </li>
                <li class="nav-item ">
                    <a class="nav-link btn btn-success" href="sign-in.php" style="padding: 10px;margin-top: 12px;color: #fff;background-color: #4cd137;">Login</a>
                </li>
                <li class="nav-item ">
                    <a class="nav-link btn btn-success" href="#package" style="padding: 10px;margin-top: 12px;color: #fff;background-color: #4cd137;">Sign Up</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<!--Nav end -->

1 个答案:

答案 0 :(得分:0)

我认为您应该在定位标记之前使用按钮标记,然后结束div标签,以使您的品牌与折叠按钮对齐。希望这对您有用