Centre Aligning ul with fluid width using css

If you have your site navigation in ul, li elements and seeking to center align the items to the center of the screen, here is the quick css for that

ul.nav{
list-style-type:none;
margin:0 auto;
display:table;
}

ul.nav li{
list-style-type:none;
display:table-column;
float:left;
}

 

This entry was posted in CSS. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *