I want to center the top menu in my site, currently it is aligned to the left.
In the CSS file the line that controls the menu is:


I tried adding:


Also tried adding to the relavnet DIV:

<div id="navigation" style="text-align:center;"><jdoc:include type="modules" name="user3" style="xhtml" /></div>

Both didn't help.

Link to my site:

How can I center this menu?

Thank you for your help :)

7 Years
Discussion Span
Last Post by diafol

just del float or for text in #navigation input text-align:center; for particular 'p' tag or other 'h' tags


I have ran into that myself. I use php inserts. Within the php insert, I make a table, align center, and make sure it is not involved in code that you already have going, (wrong place). Make sure you are not in another DIV line, pasting it in the wrong place.

A one column and one row table can be centered and will typically respond well, then put the navigation bar in the table. You can also set widths this way too, if you want that line to be a certain length. DIV will not do that either. I have set this one to 800px width, you can set to what you wish.

Try it.

<table width="800" align="center">
<td align="center">
--->Your Navigation Insert Here Cleanly Between the Div Tags<---

Good Luck!



Tables are for data, not for layout. What you need can be achieved in CSS without resorting to 90's designs.

Edited by diafol: n/a


I get clean code, XHTML 1.0 Transitional, validator.wc3.org. it is only a couple of brackets. It sure works!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.