Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 3.1.1 Nav Bar Maximized Input No Longer Maximized in 3.2.0

Question: How can I get a maximized search input in a Bootstrap 3.2.0 nav bar?

In Bootstrap 3.1.1 I used the following code for a fixed bottom nav bar to display a maximized search input.

<nav class="navbar navbar-default navbar-fixed-bottom" role="seasrch">
    <div class="container">
        <form class="navbar-form">
            <div class="form-group">
                <div class="input-group input-group-sm">
                    <div class="input-group-btn">
                        <a href="#" id="new_term" class="btn btn-default" role="button"><span class="glyphicon glyphicon-leaf"></span>&nbsp;&nbsp;New</a>
                        <a href="/terms.php" class="btn btn-default" role="button"><span class="glyphicon glyphicon-tree-deciduous"></span>&nbsp;&nbsp;All</a>
                    </div>
                    <input type="input" class="form-control" name="search_bar_text" />
                    <div class="input-group-btn">
                        <button class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</nav>

And it looked like this: Picture of maximized search using Bootstrap 3.1.1

My nav bar looks like this, after upgrading to Bootstrap 3.2.0: Picture of small search using Bootstrap 3.2.0

like image 899
Jay Haase Avatar asked Jul 06 '14 05:07

Jay Haase


1 Answers

Just add to your custom css file:

.navbar-form .input-group {
    display: table;
}
.navbar-form .input-group .input-group-addon,
.navbar-form .input-group .input-group-btn {
    white-space: nowrap;
    width: 1%;
}
.navbar-form .input-group .form-control {
    width: 100%;
}
like image 180
Alexey Kosov Avatar answered Sep 21 '22 19:09

Alexey Kosov