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?

1

1 Answer 1

0

Won't this do the trick?

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

Fiddle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.