Zen Cart Logo
Forums / General Questions / Restrict the width of search field and adjust button location

Restrict the width of search field and adjust button location

Views: 1,142

Results 1 to 8 of 8
4 May 2011, 12:13 PM
#1
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Restrict the width of search field and adjust button location

I'm looking for a way to restrict the width of this element: #navMainSearch form[method="get"] located in tpl_search_header.php

I've tried targeting the element with CSS and setting width to either a lower percentage or pixel value, so I can move the search button further to the left, so it'll be closer to the search field. Thank you!

https://www.test.soundfactory.nu

4 May 2011, 2:36 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Restrict the width of search field and adjust button location

I'm not exactly sure what you want to do, but if it's to make the search input box narrower, you would change both instances of width: 150px to a different value in the file you mentioned.

4 May 2011, 3:06 PM
#3
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: Restrict the width of search field and adjust button location

Thanks for looking at it! Well, I tried that. It decreased the search field so it became tighter. I'm trying to fit the form method[] field to display inside the light blue text field so that I can move the search button closer to the right side of the search text field. I've seen this on a lot of sites and it looks GREAT.

4 May 2011, 7:59 PM
#4
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: Restrict the width of search field and adjust button location

Fixed it using CSS.. but it's a rather brutal means of having the elements display the way I wan't (using negative margins and so).

4 May 2011, 8:14 PM
#5
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Restrict the width of search field and adjust button location

Sometimes the "rather brutal" fixes are a result of html errors. You have one error and 127 warnings on your main page.
I'd fix the missing quote in> <div id="tagcloudsideboxContent"</div></div>Then, see how many other things fall in line and fix those that don't.

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 May 2011, 8:26 PM
#6
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: Restrict the width of search field and adjust button location

Thank you for telling me. I appreciate it.

4 May 2011, 8:30 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

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

Re: Restrict the width of search field and adjust button location

:blush::blush::blush:

<div id="tagcloudsideboxContent</div></div>should either be changed to > <div id="tagcloudsideboxContent"></div> BUT...

It appears it's not used, so I would delete the entire div.

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

5 May 2011, 1:13 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Restrict the width of search field and adjust button location

Soniccc:

Fixed it using CSS.. but it's a rather brutal means of having the elements display the way I wan't (using negative margins and so).
Glad you got it sorted out.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.