A search box in Twitter Bootstrap
Asked Answered
R

1

12

I have this search box :

enter image description here

And the code of the search box is :

<form method = "post" action="search.php" class = "pull-down  navbar-search">
    <div class="input-append">
        <input class="search-query input-medium"  name="search_query" type="text" placeholder="Arama Yap" >
        <button type = "submit "class="btn btn-large" type="button"><i class="icon-search"></i></button>
    </div>
</form>

I want the search box to have no space between the box and the button. How can I accomplish it? Thanks.

Rapid answered 29/4, 2013 at 12:1 Comment(0)
L
17

Scroll down on this link to the bit that says "Search Form";

http://twitter.github.io/bootstrap/base-css.html#forms

Here's a fiddle showing it working: http://jsfiddle.net/3PgU2/

<form class="form-search">
    <div class="input-append">
        <input type="text" class="span2 search-query">
        <button type="submit" class="btn">Search</button>
    </div>
    <div class="input-prepend">
        <button type="submit" class="btn">Search</button>
        <input type="text" class="span2 search-query">
    </div>
</form>
Lightyear answered 29/4, 2013 at 12:3 Comment(3)
I have read that link and the made the changes but nothing changed visually. Here is the current form of the code : <form method = "post" action="search.php" class = "form-search"> <div class="input-append"> <input class="search-query span2" name="search_query" type="text" placeholder="Arama Yap" > <button type = "submit "class="btn" type="button"><i class="icon-search"></i></button> </div> </form>Rapid
I've added a fiddle with a working demo in my answer. Just copy that and you should be good to go.Lightyear
The difference is in the classes - form-search which you are using currently, and navbar-search which u were using previouslySelma

© 2022 - 2024 — McMap. All rights reserved.