Are you tired of the boring look of the Google Search Bar on your blog? Is it consuming too much space from your sidebar or maybe it doesn't fit the theme of your blog? Here's a quick way on how to modify your search bar to make it sleeker.
Go ahead and open the Page Element with the code for your search bar and I'll guide you on how to edit it.
1. First, copy the code and paste it into notepad in case we mess things up. Hehehe.
2. Create your own search button image or get one from the web. Or you could use mine here. Take note of its dimensions. Mine is 18 x 18.
3. Then we have to make sure that the search button is right beside the input text field.
This is how the code for the input text field usually looks like:
It should be followed by the search button code that usually looks like this:
4. Enclose them in a div with the following styles:
So the code now looks like this:
<input type="text" size="31" maxlength="255" name="q" />
<input type="submit" name="sa" value="Search" /></div>
5. Time to edit the input text field with the following styles.
Here's how it looks like now:
<input style="border:0; float:left; width:171px; margin-left:3px;" type="text" maxlength="255" name="q" />
<input type="submit" name="sa" value="Search" /></div>
6. Edit the search button to use your own image instead. Provide the URL to your image. Then include its width and height and set its style to float right.
So here it is now using my own image:
<input style="border:0; float:left; width:171px; margin-left:3px;" type="text" maxlength="255" name="q" />
<input style="float:right" type="image" src="http://lh6.ggpht.com/pinoywebsurfer /SCkFkb8bXKI/AAAAAAAAANo/h-bjqIjk-P8/go2.gif" width="18" height="18" name="sa" value="Search" /></div>
7. That's it. If you want to have a pre-defined value (e.g. Search) in your text box like mine, just add value="Search" in your input text code.
Hope this guide helped you. Of course, with adequate knowledge of CSS you can create different styles for your search bar.
Thanks to d'bug's guide for showing me how to do it in the first place. Let me know if you're having trouble implementing this.
Tuesday, May 13, 2008
Customizing your Google Search Bar using CSS
<input type="text" size="31" maxlength="255" name="q" />
<input type="submit" name="sa" value="Search" />
<div style="width: 195px; margin-top: 9px; height: 18px; background-color: #FFF;">
<div style="width: 195px; margin-top: 9px; height: 18px; background-color: #FFF;">
<div style="width: 195px; margin-top: 9px; height: 18px; background-color: #FFF;">
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment