[thelist] Centering several things horizontally in a div

Jeremy Williams jobarr at herzeleid.com
Thu Jun 19 06:51:57 CDT 2003


I am making a 1-line menu with several items on it. With tables I would make
one row, put each item into a cell, make the table the width I want, and set
each cell to center horizontally.

But, I am trying to do this with CSS. What would be the best way to get this
effect? I had 5 items, so I thought to set each one to width: 20% (my menu
is 600px wide), but that did nothing since inline elements cannot have a
width. Currently I have the left and right padding set to 3% and it seems to
almost work. But it is not perfect!

So, I am stumped. Is there any good way to do this? Some sort of workaround
to give them widths? You can see what I am doing here:


More information about the thelist mailing list