Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jan 2010
    Posts
    142
    Plugin Contributions
    0

    Default Aligning Quantity Box and Add to Cart Button

    Man, this seems like a simple thing- but I can't figure it out! I think it's something that's hardcoded into the PHP backend stuff that's causing it.

    The Quantity Box is sitting lower than the bottom of my 'Add to Cart' button. Is there a way to align the bottoms of these?
    MY SITE IS HERE

    I did try to throw this into a UL to help align it- but that didn't seem to work. Any suggestions?

    Thanks

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,981
    Plugin Contributions
    25

    Default Re: Aligning Quantity Box and Add to Cart Button

    Add to your stylesheet
    Code:
    #cartAdd input+input+input {
    	margin-bottom: -1.0em;
    	}
    And get rid of the <ul> code, as it is not going to do anything for you.

  3. #3
    Join Date
    Jan 2010
    Posts
    142
    Plugin Contributions
    0

    Default Re: Aligning Quantity Box and Add to Cart Button

    AWESOME! Glen thank you once again! Do you mind giving a quick explanation of how this works? I'm just trying to learn as I go...
    Thanks!

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,981
    Plugin Contributions
    25

    Default Re: Aligning Quantity Box and Add to Cart Button

    The input+input+input is a CSS feature called "adjacent selectors". It means that the rule will only apply (in this case) to a case where there are three <input> elements in a row; then it will apply to the last one of these. If there are four elements in a row, the last two will meet the criteria, as each of them is the third in a set.
    You can look at the left navigation on www.nyfaeriefest.com for an extreme example of this. The links are set in a slanted column by applying different left padding to each successive line.
    Code:
    #ezpages li {padding-left: 30px; height: 1.2em;}
    #ezpages li+li {padding-left: 25px;}
    #ezpages li+li+li {padding-left: 21px;}
    #ezpages li+li+li+li {padding-left: 17px;}
    #ezpages li+li+li+li+li {padding-left: 14px;}
    #ezpages li+li+li+li+li+li {padding-left: 11px;}
    #ezpages li+li+li+li+li+li+li {padding-left: 8px;}
    ...
    Note that IE6 does not support adjacent selectors (or a number of other important standard styling features), so all the links fall in one vertical indented column in that antiquated browser. If you really care about making things perfect for IE6, you will have to use some more convoluted methods.
    Last edited by gjh42; 20 Feb 2010 at 10:04 AM.

  5. #5
    Join Date
    Jan 2010
    Posts
    142
    Plugin Contributions
    0

    Default Re: Aligning Quantity Box and Add to Cart Button

    ok, that makes sense. Now- what is considered a selector? Or how is a selector defined? I see you can apply that to LI and Input... can you apply the same thing to say, text links? Images (ie- img src)? Or even something like <H2> ?

    I really appreciate the help!

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    1,937
    Plugin Contributions
    20

    Default Re: Aligning Quantity Box and Add to Cart Button

    I've found http://www.w3schools.com/ to be a big help in figuring out CSS and HTML constructs ...

  7. #7
    Join Date
    Jan 2010
    Posts
    142
    Plugin Contributions
    0

    Default Re: Aligning Quantity Box and Add to Cart Button

    I didn't find much there- but did fine THIS article...
    http://meyerweb.com/eric/articles/webrev/200007a.html

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,981
    Plugin Contributions
    25

    Default Re: Aligning Quantity Box and Add to Cart Button

    That article may be ten years old, but Eric Meyer is a CSS god, and pretty much whatever he says is to be studied and learned - not to mention that he makes it easy to understand here.

  9. #9
    Join Date
    Feb 2010
    Posts
    40
    Plugin Contributions
    0

    Default Re: Aligning Quantity Box and Add to Cart Button

    Quote Originally Posted by gjh42 View Post
    Add to your stylesheet
    Code:
    #cartAdd input+input+input {
    	margin-bottom: -1.0em;
    	}
    And get rid of the <ul> code, as it is not going to do anything for you.
    Hello,

    I seem to be having the same problem but this doesn't work for me... The "Add to Cart" button on the Listing page (not the product page) is overlapping with the bottom of the quantity box and nothing I try seems to be able to correct it. Could you please tell me what needs to be done in this case?

    My URL is http: //66.11.182.82/zen (sorry for the slow loading).

    I really appreciate your help and look forward to your answer!

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,981
    Plugin Contributions
    25

    Default Re: Aligning Quantity Box and Add to Cart Button

    With your current (TM) template, there is no add to cart button nor quantity box in the product listing page, only in the product info page. Did you change templates since your post?


    If you did mean the product info page, your template has had elements changed around and renamed, so standard style rules will frequently not work on it.
    Last edited by gjh42; 23 Feb 2010 at 07:07 AM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. shopping cart - hide the Cart Quantity Update button when not needed
    By dause in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Oct 2009, 04:28 AM
  2. Moving 'add to cart' button & aligning attribute drop-downs
    By rlfreshwater in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Sep 2008, 12:34 PM
  3. add to cart button and quantity
    By taydu in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Apr 2008, 03:30 PM
  4. Aligning Product Attributes with Add to Cart Button
    By mlm2005 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Jul 2006, 01:05 PM
  5. Only Add To Cart Button No Quantity Box
    By ryanp in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Jun 2006, 08:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •