View Full Version : converting search query box to css box -- if possible

04-30-2011, 11:53 PM
Is it possible to use a css border box for a search query box? The current one I have is established with size="31." This method is unpredictable, as the length of "31" is different in different browsers.

If I could establish a box in css in which to type a query, it may not change like the size "31" box -- in theory.

Here's my CSS to add the magnifying glass image:
background-image:url('. . . /index_files/tmg.gif');

Here's my HTML:
<form style="MARGIN: 0px" method="get" action="http://www.picosearch.com/cgi-bin/ts.pl">
<input name="index" value=" . . . 0 . . . " type="hidden"/> <input class="searchBox" onfocus="if (this.defaultValue==this.value) this.value='';" name="query" value="Search" size="31"/></form>

Is it possible to use a css border box for a query box?

Any insight would be appreciated. Thanks.

05-01-2011, 12:12 AM
Just add these to the css for .searchBox

width: 200px; /* or whatever you like */
/* add a height if you need */
border: 1px solid blue; /* there are many other border properties you can use */
but don't forget to remove size="31".

05-01-2011, 12:28 AM

Good grief, how do you know how to do all of this? It worked, just like you said!

Thank you a ton!