Forums / Templates, Stylesheets, Page Layout / Add an image behind the search in header

Add an image behind the search in header

Locked

Views: 1,007

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
9 Apr 2010, 5:16 AM
#1
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Add an image behind the search in header

HI There,

I'm wanting to add an image as a background behind the search button and text input area in on the top of the screen.

A border basically around the search but as an image.

Any input appreciated.

That wasn't the plan!

9 Apr 2010, 5:20 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add an image behind the search in header

Which search??

A link to your site would help....just place ONE space in your link to break the link so it won't get listed as in
http ://www.zen-cart.com/

Zen-Venom Get Bitten

9 Apr 2010, 5:31 AM
#3
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Add an image behind the search in header

I'm re designing site in WAMP at the moment so can't provide link and don;t have this search switched on in my live site.

It is the TOP search button and text input switched on when you setup Zen Cart.

top right.

h t t p ://demo.opensourcecms.com/zencart/

tpl_search_header I think?

That wasn't the plan!

9 Apr 2010, 5:41 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add an image behind the search in header

In your stylesheet for your template try adding a background image sized correctly to this tag

#navMainSearch

Zen-Venom Get Bitten

9 Apr 2010, 5:56 AM
#5
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Add an image behind the search in header

I tried:

#navMainSearch {
background-image: url(../images/test.png);
}

It didn't change anything unfortunately.

That wasn't the plan!

9 Apr 2010, 6:22 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add an image behind the search in header

If to the correct stylesheet - - try clearing your browser cache

Zen-Venom Get Bitten

9 Apr 2010, 8:10 AM
#7
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Add an image behind the search in header

I'm editing stylesheet.css

The cache is clean.

Force refresh (control+f5)

Tried in various browsers still no change.

Checked image file path and it is correct.

That wasn't the plan!

9 Apr 2010, 8:29 AM
#8
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Add an image behind the search in header

If I edit:

#navMainSearch {
float: left;
}

Then this moves the search box.

I only thing different about this search I can think of is that it is controlled from the layout Box Controller??

That wasn't the plan!

12 Apr 2010, 1:23 AM
#9
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Add an image behind the search in header

Still no solution to my issue.. any ideas anyone ?

That wasn't the plan!

12 Apr 2010, 7:23 AM
#10
muzz avatar

muzz

Totally Zenned

Join Date:
Mar 2009
Location:
Australia
Posts:
604
Plugin Contributions:
0

Re: Add an image behind the search in header

Hi there Kobra,

I played around a bit more with the coding you suggested and got things working.

For some reason the test image I created wouldn't work in the background of the search bar... no idea why. Right file path and wasn't corrupt. It was a png if that makes any difference.

When I tried loading another image and then it worked no problems.

So if anyone wants add an image or style the TOP search in your stylesheet.css file:

#navMainSearch {
float: right;
background-image: url(../images/yourimage.jpg);
height:50px;
width: 290px;
}

Thanks Kobra

That wasn't the plan!