Skip to content

Instantly share code, notes, and snippets.

@SaraSoueidan
Created June 8, 2013 02:40
Show Gist options
  • Save SaraSoueidan/5733754 to your computer and use it in GitHub Desktop.
Save SaraSoueidan/5733754 to your computer and use it in GitHub Desktop.
Center Navigation Horizontally - Tip 2
<nav>
<ul>
<li>..</li>
</ul>
</nav>
nav{
text-align:center;
width:intrinsic;
width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;
margin: 30px auto 0;
}
ul{
display:inline-block;
}
ul li {
float:left;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment