If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Alter search button (css) width

Alter search button (css) width

Started by mi16chap on 4 Jun 2012, 5:19 PM · Views: 902

Results 1 to 9 of 9
4 Jun 2012, 5:19 PM
#1
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Alter search button (css) width

Afternoon all

http://test.italianhampers.co.uk

I have altered the search toolbar in my site header to use the label "Go!" instead of the word "Search", however, the button is still the same width as previously set.

I set up a style in my stylesheet_css_buttons.css file as per

.button_search{width:33px;}

But if you look at my site, you can see this is being overridden by something else making it 80px (see attached screenshot with chrome "inspect element" enabled)

Attachment 10548

Can anyone tell me how to avoid this CSS conflict and make the button 33px?

4 Jun 2012, 6:06 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Alter search button (css) width

.button_search{width:33px!important;}

4 Jun 2012, 6:24 PM
#3
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Re: Alter search button (css) width

That seems to be forcing it to override and display how I would like.

Thanks for your input/help.

Andy

4 Jun 2012, 6:35 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,904
Plugin Contributions:
23

Re: Alter search button (css) width

Also, when you see element.style, it tells you that the value is hard-coded in some file.
If you did not have the option of using button.search, you would need to find the file using (using the Developer's Toolkit) and change the value there UNLESS the style is in a single-use class or id.
This particular style is in an input class that is used often throughout ZC. If it were in a class called inputSearch that were only used once, you could also use input.inputSearch {width:33px!important}

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

4 Jun 2012, 7:20 PM
#5
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Alter search button (css) width

default file where it would be hard coded is in:

/includes/templates/template_default/sideboxes/tpl_search_header.php

or

/includes/templates/YOUR_TEMPLATE/sideboxes/tpl_search_header.php

4 Jun 2012, 8:00 PM
#6
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Re: Alter search button (css) width

I was not sure if starting a new topic is necessary here, but I am after one last tweak with the search tool.

When you log into my site, the links across the top of the page display the "My account" and "log Out" urls, which are hidden unless you log in.

As the log in/ log out links change, the search bar moves around slightly

I cant find the correct combo of css to make the search tool align itself to the right of the black strip at top of my page (instead, I think it is floating to left of the last link)

Anyone got a clue how to achieve this? :smile:

4 Jun 2012, 8:34 PM
#7
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Alter search button (css) width

find

.navMainSearch {
margin:0 10px 0 0;
line-height:0;
float:right;
}

change to:
#navMainSearch {
margin:0 10px 0 0;
line-height:0;
float:right;
}

6 Jun 2012, 10:02 AM
#8
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Re: Alter search button (css) width

Thanks so much, I was messing with this for hours, and such a simple change!

6 Jun 2012, 2:18 PM
#9
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Alter search button (css) width

glad this worked for you :-)