Theme Search box position

danharper - November 6, 2009 - 11:55

I have developed a basic theme for my employer but I'm struggling with targeting the search box you can see from the link below what I mean. The search box is slightly offset and I can't work out how to target it using css.

I am using the advanced search module if that makes any difference.

If anybody could give me a few pointers that would be great.

http://www.innserveltd.co.uk

Cheers Dan

...

Jeff Burnz - November 7, 2009 - 00:55

Floats can be a pain in the arse to get right when requiring really accurate positioning and can drive me batty.

Try something different, such as using relative and absolute positioning (may need some IE6 adjustments)...

#nav {
position:relative;
}

#edit-search-theme-form-1-wrapper {
margin:0;
padding:0;
}

#top-search,
#search-theme-form #edit-submit {
position:absolute;
right:0;
}

#search-theme-form #edit-search-theme-form-1 {
position:absolute;
right:35px;
top:6px;
}

You'll want to remove the negative margin top and other attempts you have made to position the input field for this to work cleanly. The idea is really simple here, using position absolute to position both the input elements.

Thanks

danharper - November 7, 2009 - 08:55

Thanks very much I will give this a try.

Dan

It worked

danharper - November 7, 2009 - 09:00

Worked great thanks very much again

Dan

 
 

Drupal is a registered trademark of Dries Buytaert.