Results 1 to 5 of 5
  1. #1
    Join Date
    May 2011
    Posts
    3
    Plugin Contributions
    0

    Default Styling Left Boxes

    New site in development. v1.3.9. I am creating a new template from the "classic" theme.

    My problem: I cannot get rid of the space between "leftBoxHeading" and "categoriesContent". Although I have styled it with a height of 25px (same as the background image) there is still a gap of approx 10px that prevents the borders of the box below to move up against it.

    here's my css:

    .leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
    /*padding-top: 0.5em;*/
    padding-top: 5px;
    background-image: url(../images/tile_back.jpg);
    height: 25px;
    width: 190px;
    background-repeat: no-repeat;
    }

    Here's the url: http://www.customshop.co.za/zencart/

    Can anyone help?

    John.
    Cape Town

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Styling Left Boxes

    stylesheet.css (line 60)

    h1, h2, h3, h4, h5, h6 {
    margin: 0.3em 0;
    }

    Override this for the sideboxes by adding margin: 0; to
    stylesheet.css (line 555)

    .leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
    background-image: url("../images/tile_back.jpg");
    background-repeat: no-repeat;
    height: 25px;
    padding-top: 5px;
    width: 190px;
    margin: 0;
    }


    Also, your image is not 25px tall, so reduce the height to match it.
    Nevermind, the padding-top increases the height by 5px.
    Last edited by gjh42; 18 May 2011 at 03:52 PM.

  3. #3
    Join Date
    May 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Styling Left Boxes

    Thanks!

    But now my original problem has returned: How do I center the "categoriesHeading" text? As soon as I add "padding-top: 0.5em" the gap reappears!

    .leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
    /*padding-top: 0.5em;*/
    background-image: url(../images/tile_back.jpg);
    height: 25px;
    width: 190px;
    background-repeat: no-repeat;
    margin: 0;
    }

    Much appreciated.

    John.
    Last edited by tonerider; 18 May 2011 at 04:22 PM.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Styling Left Boxes

    Make the height 20px with padding-top 0.5em.

    This is a consequence of a fundamental characteristic of the CSS box model: when an element has a height or width explicitly set, padding is added to the dimension instead of filling inside the dimension as you would expect. An element with a height of 25px and padding-top of 5px will be 30px tall.
    I think it was a bad decision, but there's no changing it now.
    Last edited by gjh42; 18 May 2011 at 04:50 PM.

  5. #5
    Join Date
    May 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Styling Left Boxes

    Thanks very much!

    Works 100%

    John

 

 

Similar Threads

  1. v151 styling left side categories box
    By heemu in forum General Questions
    Replies: 4
    Last Post: 31 Jan 2013, 11:32 AM
  2. Styling Product Boxes on Homepage
    By TEROBOT in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 17 Jul 2011, 09:02 AM
  3. Two boxes, same styling, but look different
    By peedeefish in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Nov 2010, 09:08 PM
  4. styling index whats new boxes HELP
    By kitcorsa in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Jun 2009, 01:12 PM
  5. How to center Left Boxes within Column Left?
    By gingertea in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Jul 2007, 06:21 PM

Posting Permissions

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