Reputation: 11483
In upgrading to bootstrap 3, a lot of the layout for a site I am working on had to be repaired. I've managed to fix a great majority of it, however a final element of the page seems to be out of my grasp.
An example of what I am having issue with can be viewed below:
http://1ro.co/shopfine/template.html
As far as desktop version goes, it works fine. However if you shrink the page horizontally (to simulate it being the "mobile" version), the button goes wrong in two ways:
An example of what the site looked like before the move to bootstrap 3 is also below:
http://1ro.co/shopfine/account.html
I cannot figure out the issue (width?) on the tablet version, and the mobile version can't seemed to be fixed by floating any of the objects within the search bar, so in short I need to figure out in what way I can fix those two things on bootstrap 3.
Upvotes: 0
Views: 1294
Reputation: 1734
You can wrap your input-group
class with a column size e.g.
<div class="col-sm-12">
<div class="input-group">
<input type="text" placeholder="Search..." id="appendedInputButton" class="form-control">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary">
<i class="icon-search"></i>
</button>
</span>
</div>
</div>
Don't forget to add form-control
class to your input
tag.
Upvotes: 1
Reputation: 1056
You have assigned the wrong class, it should be col-sm-2
not col-md-2
to the div#searchBar
Lose the div.input-fields
and add the .form-inline
class to <form>
tag, and .form-group
to the form elements like so:
<form method="get" action="page" class="siteSearch form-inline">
<input type="text" id="appendedInputButton" placeholder="Search..." class="form-group">
<span class="input-group-btn form-group">
<button class="btn btn-primary" type="submit">
<i class="icon-search"></i>
</button>
</span>
</form>
PS sorry about the formatting, something's not righton my end
EDIT
From the bootstrap documentation:
Inputs, selects, and textareas are 100% wide by default in Bootstrap. To use the inline form, you'll have to set a width on the form controls used within.
So just follow the example code the documentation page, add necessary .form-control
tags and assign widths to them.
Upvotes: 1