My current project involves using Bootstrap 3.0.0.
While implementing the Default Navbar example with some custom CSS, I ran into an issue where the search form text box was extending to full width on Chrome. This caused my navbar to break into three lines. Surprisingly, everything was working perfectly fine on Firefox and IE.
The problem seems to arise from a discrepancy in calculated width between browsers - 236px in Firefox compared to 1110px in Chrome. Screenshots from both browsers are included below for reference, along with the code snippet available at JSFiddle. Unfortunately, the output cannot be seen there, but it serves as a helpful reference point.
My question is: Is this a known bug specific to Chrome, or did I make a mistake somewhere in my customization? If so, could someone kindly help me identify where I might have gone wrong?
Custom CSS Styles Used:
@import url(http://fonts.googleapis.com/css?family=Spirax|Oleo+Script+Swash+Caps&text=FlipKhan);
body{background: url("../images/bg.gif") scroll center top #C0C0C0;}
.navbar-top {margin-bottom: 0; min-height: 35px; height:50px;}
.navbar-top div.container{height:45px;}
.navbar-top div.container div.navbar-header{height:45px;}
.navbar-top a.navbar-brand {padding: 10px;}
.navbar-top div.container div.collapse{height:45px;}
.navbar-top .navbar-brand {font-family: 'Oleo Script Swash Caps', cursive; font-size: 35px; color: #FFF;}
.navbar-inverse {
background: none !important;
border: 0 !important;
box-shadow: none !important;
-webkit-box-shadow: none !important;
}
.navbar-inverse .nav .active > a {
background: 0 !important;
color: #333 !important;
box-shadow: none !important;
-webkit-box-shadow: none !important;
}
.navbar-inverse .nav > li > a {
color: #333 !important;
text-shadow: none !important;
}
.navbar-inverse .nav > li > a:hover {
color: #333 !important;
}
HTML Snippet (Specifically for the navbar):
<header>
<nav class="navbar navbar-top navbar-default navbar-inverse" role="navigation">
...
<!-- Code snippet continues here -->
...
</nav>
</header>
EDIT:
Applying the following line of CSS code seemed to solve the Chrome issue:
.navbar-search{max-width: 250px;}
However, I see this more as a temporary fix rather than a permanent solution. Could there be a better way to address this problem without resorting to quick hacks?