Making a adaptable width, centered with CSS ... is it possible?
Hi ! Following my previous post about text sizing I'm trying to make my code better so that my site shows up well on linux as the linux default fonts are wider than the windows ones...
At the moment I've got a menu (made up of 5 li's set to inline) with a fixed width (580px) centered on the page (margin : 0 auto.
Although on windows it shows up fine, on linux the font is not the same and is wider. And the two end "li"'s go to a new line, which means that my menu's backound is only behing the first four and the last two are out of line !!
I can see only two solutions :
1) Don't use text anymore and replace the text by images
This is not the solution I would like to take !
2) Manage to make the menu's width adapt to the contents
Sound's easy but it only works if I set the float to the left, and there fore the menu is no longer centered...
Does anyone know how I could get around this, in other words how do you make a div with an automatic width that adapts to the wording that it contains that is centered on the page?
When it is set to align left or aglin right, it's ok but when it is not set or set to auto, the DIV takes up the whole width of the page and I do not want this.
What I want is the menu to automaticaly adjust the width to the text it contains so that if you choose to up the size of the text on your browser the menu stretches instead of going to a new line. I have managed this using a table but I want my page to be W3C and W3C says only use tables for tabular data ...
Maybe this is not possible with CSS though ...