After some search, I did not find a proper way to center a list of <li>
into a fixed width div
.
Take a look at the page.. It doesn't work either!
After some search, I did not find a proper way to center a list of <li>
into a fixed width div
.
Take a look at the page.. It doesn't work either!
Steps :
style="text-align:center;"
to parentdiv
oful
style="display:inline-table;"
toul
style="display:inline;"
toli
or use
Just add
text-align: center;
to your<ul>
. Problem solved.Since
ul
andli
elements aredisplay: block
by default — give them auto margins and a width that is smaller than their container.If you've changed their display property, or done something that overrides normal alignment rules (such as floating them) then this won't work.
Another option is:
HTML
CSS: