Center list items horizontally
If you have an unordered list ul and want center horizontally its items
wrap it with a div styled with display:table and margin:auto and assign display:inline to each li
<div style="display:table;margin: 0 auto">
<ul>
<li style="display:inline"> item1 </li>
<li style="display:inline"> item2 </li>
<li style="display:inline"> item3 </li>
</ul>
</div>
Written by Andrea Puggioni
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#