Best way to use Bootstrap 3 Navbar without responsive collapse

后端 未结 2 1277
悲&欢浪女
悲&欢浪女 2020-12-15 03:42

I\'m trying to create a simple Navbar in Bootstrap 3 that doesn\'t collapse - responsive isn\'t necessary here because we just have a simple title on the left + button on th

相关标签:
2条回答
  • 2020-12-15 04:12

    The best way I could find is to use 2 navbar-header containers, and then use pull-left and pull-right since they aren't tied to any responsive media queries..

    <div class="navbar navbar-fixed-top">
        <div class="navbar-header pull-left">
          <a class="navbar-brand" href="#">Title Here</a>
        </div>
        <div class="navbar-header pull-right">
          <button type="button" class="btn btn-default navbar-btn">Button 1</button>
          <button type="button" class="btn btn-default navbar-btn">Button 2</button>
        </div>
    </div>
    

    Demo on Bootply: http://bootply.com/74912

    0 讨论(0)
  • 2020-12-15 04:29

    In my case, i only used the navbar-header and nothing else.

    Basically, the navbar-header would help me easily get all the header css in there. Inside of it, i added a container and played around with my options for a similar case as yours.

        <nav class="navbar navbar-default navbar-fixed-top" id="transient-header">
            <div class="container clearfix">
                <div class="transient-header-block clearfix">
                    <h1 class="hide" href="/" style="color: #fff;">Primary</h1>
                    <a class="navbar-brand" href="/">{{> svgs/logos/_white_symbol}}</a>
                    <div class="pull-right price">
                        <a href="#" class="btn btn-white-border contact-modal" href="#contactModal">
                            {{> svgs/_white_rupee_icon}}
                            {{product.price}}
                        </a>
                    </div>
                </div>
            </div>
        </nav>
    
    0 讨论(0)
提交回复
热议问题