Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8571843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:52:17+00:00 2026-06-11T18:52:17+00:00

I am using the bootstrap responsive navbar to collapse links in the navbar when

  • 0

I am using the bootstrap responsive navbar to collapse links in the navbar when the screen is smaller. I want to keep a button and a search box out of the collapsed area though. This is my code:

<div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid">                    
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>

               <a class="brand" href="/">site name</a>

                <div class="nav-collapse">
                    <ul class="nav">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Other</a></li>    
                    </ul>
                </div>

                <form action="#" class="navbar-search pull-left">
                    <input name="search" class = "search-query" />
                </form>

                <div class="btn-group pull-right">
                    <button class="btn btn-primary">Log In</button>
                </div>
            </div>
        </div>      
    </div>

This looks fine when on a normal screen but once the links collapse, the button and search box are forced below, doubling the height of the nav.

If I move the search box to the left of the nav-collapse links, it works ok but I need the links to show up first.

Any ideas how to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:52:18+00:00Added an answer on June 11, 2026 at 6:52 pm

    Hard to tell without testing, but you could try adding a white-space: nowrap style to the container.

    <div class="container-fluid nowrap">
    

    CSS:

    .nowrap { white-space: nowrap; }
    

    EDIT:
    Did some testing, I believe this emulates the behavior you’re looking for:

    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid">                    
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
    
               <a class="brand" href="/">site name</a>
    
               <div class="btn-group pull-right">
                    <button class="btn btn-primary">Log In</button>
                </div>
                <div class="pull-left">
               <form action="#" class="navbar-search pull-right">
                    <input name="search" class = "search-query" />
                </form>
    
                <div class="nav-collapse pull-right">
                    <ul class="nav">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Other</a></li>    
                    </ul>
                </div>
                </div>
            </div>
        </div>      
    </div>
    

    CSS:

    @media (max-width: 979px) {
        .navbar .btn-navbar { float: left !important; }
        .navbar-search { float: left; }
    }
    

    Basically, just float the links and search bar to the right and wrap them in a div that floats left (to mimic the current behavior on screen widths > 979px).
    Then, float the links and search bar to the left when the window is shrunk to avoid the linebreak.

    It will still break on very small screen widths, simply because the search bar is too wide to fit with the rest of the content. You can prevent this by overriding its width accordingly.
    For example:

    .search-query { width: 150px !important }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I developed a site using twitter bootstrap and it seems that the responsive layout
I'm creating a dynamic responsive week calendar, using Twitter Bootstrap . Here's my current
I am using bootstrap on my site and am having issues with the navbar
When I create an input box in topbar using bootstrap css, the placeholder value
Using Twitter's Bootstrap's standard 940px fluid grid responsive grid I'm trying to get multiple
I'm finding Twitter Bootstrap extremely frustrating because even when using the non-responsive stylesheet, the
Using a default/vertical form, the bootstrap documentation suggests that the submit button sits underneath
I'm creating a Site using Twitter Bootstrap 2.0.4 + bootstraps responsive.css. What I don't
Using Bootstrap Responsive - HTML appears like... <div class=row-fluid Center> <div id=divMapCanvas class=span6> <div
How to use custom variables when using twitter-bootstrap-rails gem? I want to change the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.