Search code examples
htmlcssstyles

How do I change the width of this Search Bar?


It already has a prefixed width on the stylesheet but I have two different searchbars so I cannot modify that one, is there a way to override that width and change it to 200px? THanks

<div id="search-10" class="widget_search">
<form role="search" method="get" id="searchform" action="http://chusmix.com/?s=" onsubmit="window.location = action + s.value + '+: Cordoba'; return false;">
    <div>
    <input class="ubicacion" type="text" value="" name="s2" id="s" style="margin-left:0px;">
    <input type="submit" id="searchsubmit" value="Buscar">
    </div>
    </form>
</div>

Solution

  • As you see the id of your "search bar" which is actually called textbox is s

    So you just have to put in you CSS

    #s
    {
        width:200px;
    }
    

    See a working example here:

    http://www.jsfiddle.net/hdm4Q/