Forums / Setting Up Categories, Products, Attributes / Switching placement of 'Qty' text with box next to it?

Switching placement of 'Qty' text with box next to it?

Locked

Started by kismetdesign on 8 Dec 2009, 8:06 PM · Views: 1,089

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
8 Dec 2009, 8:06 PM
#1
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Switching placement of 'Qty' text with box next to it?

http://www.eaglerockbooks.com/index.php?main_page=product_info&cPath=78_92&products_id=181

Right now on this product info page the checkboxes for the attributes are all aligned to the left. Then down below it the quantity box is in the center. Is there a way to switch the placement of the Qty text with the box next to it, so all the boxes are lined up to the left?

Thanks for any suggestions! :P

KD

8 Dec 2009, 8:23 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Switching placement of 'Qty' text with box next to it?

Add to your stylesheet_tm.css```
#cartAdd {position: relative; padding-left: 3.2em;}
#cartAdd input {position: absolute; left: 0;}
#cartAdd input+input {position: static;}

The padding pushes the Qty: to the right. 
The position: absolute; takes the input box out of layout flow and lets it be located at the empty left edge of the container.
The input+input is needed to limit the effect to only the first input in the container.
8 Dec 2009, 11:12 PM
#3
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Re: Switching placement of 'Qty' text with box next to it?

Okay, did that, and it looks much better in Firefox. However, in IE the placement is quite a bit different, with the add to cart button actually covering up the qty text and box.

I'm going to attach both screenshots so you can see what it looks like both ways.

IE is the first screenshot, Firefox is the second one.

:P

11 Dec 2009, 5:19 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Switching placement of 'Qty' text with box next to it?

What version of IE are you using? IE6 at least doesn't understand adjacent selectors, so it will ignore this rule
#cartAdd input+input {position: static;}
and put all the inputs at the left edge.

The Add button does have a class name, ".input", so you should be able to specify that instead. There will probably be no problem with the hidden second input being at the left.

#cartAdd .input {position: static;}
15 Dec 2009, 9:17 PM
#5
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Re: Switching placement of 'Qty' text with box next to it?

When I took out what you had given me before, and replaced it with just the last line #cartAdd .input {position: static;}, it just reverted back to what it was before, the text before the Qty box.

Obviously I did something wrong here. :blink:

15 Dec 2009, 9:41 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Switching placement of 'Qty' text with box next to it?

You want to keep all of the previous rules and add the latest one.
The latest one partially replaces the
#cartAdd input+input {position: static;}
but it won't hurt to have them both there.

16 Dec 2009, 11:53 PM
#7
kismetdesign avatar

kismetdesign

Zen Follower

Join Date:
May 2009
Location:
Junction City, Oregon
Posts:
315
Plugin Contributions:
0

Re: Switching placement of 'Qty' text with box next to it?

Got it! And it works :clap:

Thank you!

KismetDesign