I’m struggling with centering my main container, although that is maybe not the right description, because it’s more an optical problem. I have a simple two column site: left #sidebar(menu), right Content. The container has a fixed width of 960px; The problem I have is with the sidebar. The sidebar has a fixed width of 300px ( since I don’t know the width of the widest menu item.) and the menu items have the property text-align: right; So although the container is centered, because of the right alignment of the menu items in the fixed width sidebar, it looks like it’s not. What would be the best solution in this case? Shoud I not set a width for the sidebar?
Hi Paul. You can find the layout as I now have it here
In this example I have no width for the menu column(left) but was forced to set a width for the right column. If I didn’t set a width it was wrapping left under the menu?
What is in your opinion the best solution for this?
Thanks for the response. That doesn’t seem to work. It was the left side that optical is bigger, so I tried it with left: -150px; but than the container is to much to the left instead, which is not longer optical.
It would be easier if we could see the design but your first suggestion of not setting a width should allow the menu to sit on the left but allow items to be right aligned with the longest item.