Create navbar with centralized search field

Asked

Viewed 110 times

2

are trying to make a Nav bar with a centralized search field.. I even managed to do more I believe I’m not in the best way, because when I open on a smartphone everything gets weird...

Follow my code below.

 <div class="top_nav">
        <div class="nav_menu">
          <nav>
            <div class="nav toggle">
              <a id="menu_toggle"><i class="fa fa-bars"></i></a>
            </div>

            <!-- campo para pesquisa-->
            <form class="navbar-form navbar-left" action="listaProcessos.html">
              <div class="input-group" style="margin: 4px 0 0 250px; width:400px">
                  <input type="text" class="form-control" placeholder="Pesquisar">
                  <div class="input-group-btn">
                    <button class="btn btn-default" type="submit" >
                        <i class="glyphicon glyphicon-search" style="color:#5A738E"></i>
                    </button>
                  </div>
              </div>
            </form>
            <!--fim campo de pesquisa-->


          </nav>
        </div>
    </div>
  • Put your css, it makes it easier to help you

  • By any chance are you using Bootstrap? If yes which version?

  • The bootstrap version is v3.3.7

2 answers

0

  • Young only he is using Bootstrap 3... And even if Foce 4 vc could use framewark native classes like d-flex, Justify-content-center, w-100 as you can see here https://getbootstrap.com/docs/4.0/utilities/flex/

0


Try to use:

style="padding: 0 10% 0 10%;"

in place of:

style="margin: 4px 0 0 250px; width:400px"

you can adjust the padding in percentage to let the search input in the desired size.

  • for me that was enough, thanks man.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.