Geek Answers Handbook

Multiple fixed top navigation bars on Twitter. Is bootstrap 3 not working correctly?

html:

<div id="wrap">
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <div class="navbar-brand logo"></div>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="#">Item1</a>
                    </li>
                    <li class="divider-vertical"></li>
                    <li>
                        <a href="#about">Item2</a>
                    </li>
                    <li class="divider-vertical"></li>
                    <li>
                        <a href="#contact">Item3</a>
                    </li>
                    <li class="divider-vertical"></li>
                    <li>
                        <a href="#contact">Item4</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="navbar navbar-default navbar-static-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".main-nav">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="collapse navbar-collapse main-nav">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="#">it1d</a>
                    </li>
                    <li class="divider-vertical"></li>
                    <li>
                        <a href="#about">it2d</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="container">
        <div>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
            <h1>HEllO</h1><br>
        </div>
    </div>
</div>
<!-- FOOTER -->
<div style="clear: both"></div>

CSS

body {
  padding-top: 50px;

}

.navbar-static-top{
position: fixed;
right: 0;
left: 0;
z-index: 1000;background: #ccc;
}

Click here: http://www.bootply.com/101069

In the above code, I use two navigators, which I want to commit to the top of the page. The code works fine for desktops and laptops, but when they are visible on a mobile phone. the first navigation bar is the fix, and the second navigation bar is down. so what I need to do is to fix both the navigators at the top of both desktops and mobile phones. Any help would be appreciated ??

+4
jquery html css twitter-bootstrap navbar
User2413 Jan 20 '15 at 9:32
source share
1

navbar-static-top . navbar-fixed-top , . ( ) ( ), , : top:50px; Bootply: http://www.bootply.com/Xd04ROsODx

+7
Guillaume 20 . '15 9:48

More articles:

  • JavaScript called sorting function - javascript
  • to find subclasses of this class in jdk lib - java
  • compile persistent memory array into immediate value in CUDA - gpu
  • How to set different legends for MATLAB errorbar plot dot and vertical line? - matlab
  • Create a new torrent and seed - python
  • RabbitMQ: throttling a fast producer against large queues with a slow consumer - throttling
  • How to find and set text in UILabel UITableViewCell in Swift? - ios
  • Drawing an uneven circle using JavaFX - java-8
  • RabbitMQ queue length limit with flow control - rabbitmq
  • Почему CSS-фреймы используют! Важные тэги без необходимости? - css

All Articles

Geek Answers | 2019