i'm putting together a zen subtheme.
i've populated the primary links menu and begun to style it.
the primary links aren't in any block or region... they're just where the zen template puts them, like this:

<div id="navbar">
   <div id="navbar-inner">
      <div id="primary">       
         <ul class="links">
            <li>item</li>
            <li>and so on...</li>
         </ul>
      </div>
   </div>
</div>

i've commented out the default left margin for the primary and secondary links, so the nav links flush left within the bar. and now absolutely nothing i do will set those links to center within the nabvar. putting "text-align:center" in any level of the above appears to do nothing. putting "margin:0 auto", same non-result.

argh.
help?

Comments

Jeff Burnz’s picture

bigjim’s picture

I would like to pull this off, so yes I would like to center the ul within the div.

I'm not a css guru by any means but I can't believe how hard a time I am having with this.

Jeff Burnz’s picture

Do you have the site live? Would be easier to deal with the actual code you are using (please don't post it here for my sake, a link to your site will be better). I know this can be tricky;)

diysista’s picture

Hi- I need help centering the primary links in the zen theme too. I have no experience with css. what is the "ul" and what is the "div" how to I get this to center...where do I start, how do I get into css and when i do where do i go and what do i do to get it to center?

thank you!

gforce301’s picture

bigjim’s picture

gforce301 thanks, that did it, I have to figure out some glitches that it presents for Son of Suckerfish menus but at least the gave me the guidance to get things centered

gforce301’s picture

Most excellent. Glad I could help. The concepts in that article definitely require tweaking for any given css layout and a decent understanding of some advanced css techniques but, I have used that method successfully to center floated block level elements of all types.

Keep up the good work man.

Edit:

Btw, what issues does it cause with your menus? I might be able to help you there also.

bigjim’s picture

it turned out to be more of an issue with one of my many attempts to fix the centering issue, all I had to do was set padding to 0 on one of the secondary link's selectors.

cheers