K
K
kepmake2018-09-26 18:04:51
Bootstrap
kepmake, 2018-09-26 18:04:51

I put navbar-brand position absolute and navbar-toggler button moves to the left, how to fix it?

How can I make the button appear on the right when the window is reduced?
Float right doesn't work, and full page margin doesn't seem like a good idea.

<header >
        <div class="container">
            <nav class="navbar navbar-expand-lg navbar-light navbar-right  ">
  <a class="navbar-brand " href="#"><img src="assets/template/img/logo.png" alt=""></a>
  <button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav  ">
     <li class="nav-item">
        <a class="nav-link" href="#">1</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">2</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">3</a>
      </li>
       <li class="nav-item">
        <a class="nav-link" href="#">4</a>
      </li> <li class="nav-item">
        <a class="nav-link" href="#">5</a>
      </li> <li class="nav-item">
        <a class="nav-link" href="#">6</a>
      </li> <li class="nav-item">
        <a class="nav-link" href="#">7</a>
      </li>
    </ul>
    
  </div>
</nav>
</div>
    </header>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sharomet, 2018-09-28
@sharomet

So it is already on the right and without position absolute.
code pen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question