{"id":361,"date":"2007-12-06T15:18:54","date_gmt":"2007-12-06T22:18:54","guid":{"rendered":"http:\/\/css-tricks.com\/centering-list-items-horizontally-slightly-trickier-than-you-might-think\/"},"modified":"2018-05-01T12:38:25","modified_gmt":"2018-05-01T19:38:25","slug":"centering-list-items-horizontally-slightly-trickier-than-you-might-think","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/centering-list-items-horizontally-slightly-trickier-than-you-might-think\/","title":{"rendered":"Centering List Items Horizontally (Slightly Trickier Than You Might Think)"},"content":{"rendered":"
Update April 2013:<\/strong> This article is pretty old. This isn’t very hard. Just give the list centered text (e.g. ul.nav { text-align: center; }<\/code>) and the list items inline-block (e.g. ul.nav li { display: inline-block; }<\/code>). If you want to do it with margin for whatever reason, look into width: fit-content;<\/code>.<\/div>\n

The current standard in coding menus is unordered lists. It’s not as semantic as a <nav><\/code> tag would be, but it’s not that bad. Navigation is, after all, a list of sorts.<\/p>\n

If you want to make this navigational unordered list horizontal<\/strong>, you have basically two options:<\/p>\n