Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap standard navbar search form splits on chrome

I'm trying to learn bootstrap but however i'm facing problem with multi-browser support. standard inverse navbar looks fine on firefox but search form splits on chrome. I tried using col-sm-* but was no help? Why i'm facing this issue?Is there anyway to solve this problem without custom css?? I checked this question too Bootstrap navbar-form width issue on chrome This is somewhat similar issue but in my case search icon goes to rightmost corner of nav and input field on leftmost corner. Here is my html for navbarThis is how it appears on chromeThis is firefox view and it looks fine

<nav class="navbar navbar-inverse navbar-static-top" role="navigation" style="padding-right: 10px;">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">

      <a class="navbar-brand" href="#">Hello</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class=" nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">Link</a></li>

        <li class="dropdown">
        </li>
      </ul>
        <form class="navbar-form navbar-left" role="search">
        <div class="form-group">
            <div class="input-group">
                  <input type="text" class="form-control">
                  <span class="input-group-btn">
                    <button class="btn btn-default" type="button"><span class='glyphicon glyphicon-search'></span></button>
                  </span>
            </div>
       </div>
      </form>
      <ul class="nav navbar-nav navbar-right">

      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
like image 936
carefree Avatar asked Feb 12 '14 02:02

carefree


1 Answers

It looks like you need to:

  • remove the class, "navbar-left", from the form tag on line 18,
  • and the class, "form-group", from the div on line 19.

So:

<form class="navbar-form navbar-left" role="search">
<div class="form-group">

Make it:

<form class="navbar-form" role="search">
<div>
like image 158
danwarfel Avatar answered Oct 11 '22 07:10

danwarfel