导航栏折叠的CSS修复

时间:2014-04-25 00:41:06

标签: css twitter-bootstrap navbar collapse

我知道这是一个很多人都有的问题,但是不熟悉Less并且不熟悉Bootstrap,我正在寻找一个全新的CSS解决方案,以防止我的导航栏在768 px以下崩溃:

<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container-fluid header-top">
        <ul class="navbar-nav navbar-left list-inline contact-links">
          <li><a href="tel:180042762687"><span class="glyphicon glyphicon-earphone"></span></a></li>
          <li><a href='****live chat**'><span class="glyphicon glyphicon-comment"></span></a></li>
          <li><a href="mailto:***@***"><span class="glyphicon glyphicon-envelope"></span></a></li>
          </ul>

      <ul class="navbar-nav navbar-right list-inline account-and-cart-links">
        <li><a href="my-account.html"><span class="glyphicon glyphicon-user"></span></a></li>
        <li><a href="my-cart.html"><span class="glyphicon glyphicon-shopping-cart"></span></a></li>
      </ul>

  </div>

</div>

1 个答案:

答案 0 :(得分:0)

pull-leftpull-right添加到<ul>

JSFiddle

<div class="navbar navbar-default navbar-fixed-top" role="navigation">
     <div class="container-fluid header-top">
        <ul class="navbar-nav navbar-left pull-left list-inline contact-links">
            <li><a href="tel:180042762687"><span class="glyphicon glyphicon-earphone">
                </span></a></li>
            <li><a href='****live chat**'><span class="glyphicon glyphicon-comment"></span></a></li>
            <li><a href="mailto:***@***"><span class="glyphicon glyphicon-envelope"></span></a></li>
        </ul>

        <ul class="navbar-nav navbar-right pull-right list-inline account-and-cart-links">
            <li><a href="my-account.html">
                <span class="glyphicon glyphicon-user"></span></a></li>
            <li><a href="my-cart.html">
                <span class="glyphicon glyphicon-shopping-cart"></span></a></li>
       </ul>
     </div>
</div>