Skip to content

Style your search and input boxes PDF Print E-mail
Written by Administrator   
Friday, 15 September 2006
Tired of boring search and contact fields? With CSS we can change that very fast. Open your template_css.css file and look for something called: "div.search input" the name might look different in some templates, but you should be able to find it or something similar.

In case the tag is not mentioned in your template at all, you can find the right tag by using the Web Developer extension for Firefox.  Still not sure what I am talking about try looking in one of my other tutorials. For instance have a look in the first tutorial I made for the Rocket Theme Internet Gazette template.

As you can see there is not a lot of text in this CSS section, but try and add the following, so it looks like this:

div.search input {
margin-top: 10px;
width: 145px;
color: #fff;
background: #B8BEC2;
padding-left:5px;
border: 1px solid #41566E;
}

The colors are just something that worked with my theme, but you can change it to whatever you like. I can tell you a little about the different tags. "margin-top" adds a little "air" on top of the search filed so it doesn't get too cluttered. The "width" statement indicates the length of the text field. The "color" defines the color of the text. "background" defines the background color, "padding-left" adds a little air to the left of the text in the text field. And finaly "border" gives the box a nice thin stroke with a chosen color.

The contact fields might not be defined in the CSS, but you do that quickly as well. Somewhere in your css file, add the following:

.inputbox {
color: #fff;
background: #B8BEC2;
padding-left:5px;
border: 1px solid #41566E;
}

That should add the same values as the search field and make both parts look good together. This method also makes it possible to make the search box look different compared to all the other boxes. If you just need one look, then you can leave the "div.search input" alone and just add the whole ".inputbox" section.

Remember that backgrounds can be more than just a color, if you add a url ref to a background image, then you can pimp your boxes even more. A definition would look something like this (depending on how your image should repeat):

.inputbox {
color: #fff;
background: #B8BEC2 url (../images/some_background.png) 0 0 no-repeat;
padding-left:5px;
border: 1px solid #41566E;
}

And if you need some seriously nice templates to play with, don't hesitate to join the Rocket Theme Club.

Have fun
Thomas

Last Updated ( Sunday, 19 November 2006 )
 
< Prev   Next >

Subscribe to newsletter

If you want information when new articles, reviews, tutorials arrive then sign up for this newsletter. You can always unsubscribe if you don't want to receive the newsletter any more.






perForms Module

No Form found.

Top