0

I often want to horizontally center an horizontal menu (an unordered list with the li elements floated) without specifyling a fixed width, so that the menu remains centered in all resolutions.

To my knowledge there's no way to achieve that, but perhaps there is some little know trick to achieve it?

drake035
  • 3,955
  • 41
  • 119
  • 229
  • 1
    http://stackoverflow.com/questions/1203910/css-horizontal-menu-equally-spaced OR http://stackoverflow.com/questions/5082067/css-dynamic-horizontal-navigation-menu-to-fill-up-specific-width-table-behavior OR http://stackoverflow.com/questions/49536/how-do-i-really-justify-a-horizontal-menu-in-htmlcss – Krzysiek Aug 24 '14 at 10:12

1 Answers1

0

Won't this do the trick?

ul{
    list-style:none;
    width:100%;
    text-align:center;
}
li{
    display:inline-block;
}

Fiddle

verism
  • 1,106
  • 1
  • 12
  • 35