Skip to content

Instantly share code, notes, and snippets.

@SaraSoueidan
Created June 8, 2013 02:39
Show Gist options
  • Save SaraSoueidan/5733752 to your computer and use it in GitHub Desktop.
Save SaraSoueidan/5733752 to your computer and use it in GitHub Desktop.
Center the navigation horizontally - Tip 1
<nav class="navbar center"><!--this goes inside the header-->
<ul>
<li><a href="/">Home</a></li>
<li><a href="/">About us</a></li>
<li><a href="/">Our products</a></li>
<li><a href="/">Customer support</a></li>
<li><a href="/">Contact</a></li>
</ul>
</nav>
.center ul{
width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;
margin: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment