A little Menu Help; Howto distribute the menu items evenly

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
jdwork
Forum Members
Forum Members
Posts: 10
Joined: Sat Dec 23, 2006 7:03 pm

A little Menu Help; Howto distribute the menu items evenly

Post by jdwork »

Hello CMS:

  You have wicked product!  ;D Exactly what I need.  I have Ubuntu 6.06 LAMP with CMS Maui.  Everything worked out of the box, zero headaches, and what a beautiful install script. I am using the template CSSMenu Top + 2 Columns with Layout: Top Menu + 2 Columns & Navigation: CSSMenu Horizontal.

  I am redoing a Montessori Preschools website and changing as little as possible from the default templates to stay compatible with IE users and not mess anything up (using KISS principle).

To my question:

I would like to center the elements of my navigation bar leaving equal space before and after the first and last elements
or equally acceptable
I would like to evenly distribute the elements of my navigation bar leaving no space before and  after the first and last element.

Any comments or suggestions are appreciated.

Thankyou,
Jesper
casidougal
Forum Members
Forum Members
Posts: 98
Joined: Tue Jun 06, 2006 10:08 pm
Location: USA

Re: A little Menu Help; Howto distribute the menu items evenly

Post by casidougal »

I've been waiting to see if someone has a good solution for this. This same issue has been frustrating me...I can cheat by playing with the width attribute e.g.

#menuwrapper {
/*  overflow: hidden;  */
background-color: transparent;
margin-left: auto;
margin-right: auto;
z-index: 500;
position: relative;
margin-bottom: -2px;
width: 95%;
}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: A little Menu Help; Howto distribute the menu items evenly

Post by Dr.CSS »

If you had a link I could whip something up for it, I've got a few on my site but would not be able to tell you your solution w/o seeing it, usually margin: 0px auto; works but where to put it is the ? menu, menuwrapper, wrapper? depends...
casidougal
Forum Members
Forum Members
Posts: 98
Joined: Tue Jun 06, 2006 10:08 pm
Location: USA

Re: A little Menu Help; Howto distribute the menu items evenly

Post by casidougal »

I know I'm not the original poster of this topic but I have a couple examples...

http://treasurevalleyhearing.com/

http://richardsteeledds.com/&nbsp; <-- on this one I used my "cheat" to get it close to being centered.
Last edited by casidougal on Sun Feb 04, 2007 3:43 am, edited 1 time in total.
heatherfeuer

Re: A little Menu Help; Howto distribute the menu items evenly

Post by heatherfeuer »

Elements can be centered using CSS by setting a margin value of '0 auto'.
casidougal
Forum Members
Forum Members
Posts: 98
Joined: Tue Jun 06, 2006 10:08 pm
Location: USA

Re: A little Menu Help; Howto distribute the menu items evenly

Post by casidougal »

#menuwrapper {
/*  overflow: hidden;  */
background-color: transparent;
margin: 0px auto;
}

Doesn't center my menu...did I get something wrong?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: A little Menu Help; Howto distribute the menu items evenly

Post by Dr.CSS »

If you don't make the menuwrapper a certain width it will go 100% on it's own so you need to make it less than the page or div it's in to see any shift, notice casidougal has 95% width in his...
Post Reply

Return to “Layout and Design (CSS & HTML)”