View Full Version : Centering a menu

Feb 2nd, 2007, 11:09 PM

I'm using the menu that I got from this website - http://www.javascriptkit.com/script/script2/csstopmenu.shtml

It's sits more left than centered. Can anyone please help me. I want to center the menu. I've tried the <center> tags and the <p align="center"> tags, but that doesn't work. I don't know css or js very well, but it may be something in those files. Please help me center my menu on my pages. Thanks, Steve

Feb 3rd, 2007, 12:10 AM
Please help :)

Feb 3rd, 2007, 12:25 AM
it might be easier if we got a link to your site

Feb 3rd, 2007, 12:30 AM
agree, it would have been nice to see what you have so far.

Well, I didn't look at it so carefully, but it seems that the <ul> element is floated. This is why it is hard to center it.

You may have to put it in a one-cell table (which will shrink in size depending on the content):

<table id="dummytable" cellspacing="0" cellpadding="0"><tr>
<td>here goes your menu</td>

together with:

#dummytable {
margin: 0 auto;

I don't know if there are easier ways. Maybe someone else knows.

Mainly, this is because we don't have full support for display: inline-block in IE.

Feb 3rd, 2007, 01:07 AM
Yes!!! Putting it in a table worked...thanks so much man. Have a great weekend :)