0

Hi,

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:

#navigation{height:35%;margin-top:1px;font-size:12px;background-color:#E5F0FA;overflow:hidden;width:100%;float:left;}

I tried adding:

margin-left:auto;margin-right:auto;

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:
http://www.gamestoenjoy.com

How can I center this menu?

Thank you for your help :)

4
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by diafol
0

is there any reason for the float?

0

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

0

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">
<tr>
<td align="center">
<div>
--->Your Navigation Insert Here Cleanly Between the Div Tags<---
</div>
</td>
</tr>
</table>
]

Good Luck!

SEODomainNames.com

0

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

0

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.