Nur Uddin
Nur Uddin

Reputation: 2948

Bootstrap full width search box

I try to make a full width search box. its working in tab and mobile but not working in desktop or laptop

Here is my code

<div class="row">
<div class="col-md-offset-2 col-sm-offset-2 col-xs-offset-1 col-md-8 col-sm-8 col-xs-10">    
<form action="" autocomplete="off" class="navbar-form" method="post" accept-charset="utf-8">
        <div class="input-group">
            <input name="searchtext" value="" class="form-control" type="text">
            <span class="input-group-btn">
               <button class="btn btn-default" type="submit" id="addressSearch">
                   <span class="icon-search"></span>
               </button>
            </span>
        </div>
    </form>
</div>
</div>

when I see the responsive view its working on mobile and tab view enter image description here

But its not working in desktop view enter image description here

Upvotes: 5

Views: 14400

Answers (3)

Hardik Gondalia
Hardik Gondalia

Reputation: 3717

Remove you nav-bar class and add form-horizontal

<form action="" autocomplete="off" class="form-horizontal" method="post" accept-charset="utf-8">
        <div class="input-group">
            <input name="searchtext" value="" class="form-control" type="text">
            <span class="input-group-btn">
               <button class="btn btn-default" type="submit" id="addressSearch">
                   <span class="icon-search"></span>
               </button>
            </span>
        </div>
    </form>

Upvotes: 11

Darren Willows
Darren Willows

Reputation: 2131

<div class="row">
   <div class="col-md-offset-2 col-sm-offset-2 col-xs-offset-1 col-xs-10 col-sm-8 col-md-8 col-lg-6">
     <div class="form-group">
        <input name="searchtext" value="" class="form-control" type="text">
        <span class="input-group-btn">
           <button class="btn btn-default" type="submit" id="addressSearch">
               <span class="icon-search"></span>
           </button>
        </span>
    </div>
   </div>
</div>

Upvotes: -1

mahethekiller
mahethekiller

Reputation: 514

Give col-lg-12 class to the div

<form action="" autocomplete="off" class="navbar-form" method="post" accept-charset="utf-8">
<div class="input-group col-lg-12">
    <input name="searchtext" style="width:100%" value="" class="form-control" type="text">
    <span class="input-group-btn">
       <button class="btn btn-default" type="submit" id="addressSearch">
           <span class="icon-search"></span>
       </button>
    </span>
</div>

Upvotes: 1

Related Questions