Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Category List Spacing

Category List Spacing

Locked

Views: 1,586

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
18 Aug 2007, 5:42 PM
#1
copels avatar

copels

New Zenner

Join Date:
Feb 2006
Posts:
51
Plugin Contributions:
0

Category List Spacing

Hi

I'm trying to put some space between the category items in my menu.

http://www.giftsfromwales.com/shop/index.php?main_page=index&cPath=20

I've used the following code in the stylesheet:

A.category-top {
display:block;
padding-top:0px;
padding-bottom:0px;
margin-top:0px;
margin-bottom:0px;
}

Problem is when I use this code it puts a space in before I even start tweaking! If I turn on the product count this appears on the line underneath!

Also the space is between the category & sub categories which makes it confusing - probably would have been alright if the space was after the sub-categories!

Can anybody help?

Thanks

Steve

19 Aug 2007, 3:16 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Category List Spacing

Adding this to your stylesheet will close up those gaps> #categories br {line-height:0}though not answer why they have appeared in the first place.

19 Aug 2007, 5:26 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Category List Spacing

Since the default category item is inline display, it needs a <br /> to ensure that it has its own line.

display:block; makes it a separate line, so there is now duplication of effect.

19 Aug 2007, 5:46 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Category List Spacing

Good spot Glenn

That would also explain why the product counts get pushed onto the next line, since display: block will cause the <a> tags to expand to take up the full width available.

19 Aug 2007, 6:26 PM
#5
copels avatar

copels

New Zenner

Join Date:
Feb 2006
Posts:
51
Plugin Contributions:
0

Re: Category List Spacing

Thanks for your help. I removed the block command but now none of the margin or padding code makes any difference - am I missing something?

A.category-top {

padding-top:0px;
padding-bottom:0px;
margin-top:10px;
margin-bottom:10px;
}

Website now at https://www.giftsfromwales.com

Thanks for looking.

Steve

19 Aug 2007, 6:46 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Category List Spacing

If you disable the category counts and symbols in admin, you can use display: block; just fine with Kuroi's tweak (though you may need to add display: block; to the subcats also).

The easy answer (for me) is to use Categories Dressing, as that has already set everything necessary and you just need to follow the instructions & examples in the readme to use the stylesheet for full control.

19 Aug 2007, 7:10 PM
#7
copels avatar

copels

New Zenner

Join Date:
Feb 2006
Posts:
51
Plugin Contributions:
0

Re: Category List Spacing

Perfect - thanks for all your help!

Steve

6 Sep 2007, 3:08 PM
#8
dpeters avatar

dpeters

New Zenner

Join Date:
Aug 2007
Posts:
1
Plugin Contributions:
0

Re: Category List Spacing

This should be a list menu.

6 Sep 2007, 4:40 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Category List Spacing

I have considered that, but need to research whether non-list elements can be displayed between list items. If that does not cause problems, I may try it. Other mods I have seen indicate that it is a problem - though maybe they are just being overcautious.

Many other mods to tpl_categories.php would also be required, as <li> display would make the existing count display setup malfunction. I would need to set up a whole new method for ensuring that those who want the default style of category name display can do so.