Created
June 8, 2013 02:39
-
-
Save SaraSoueidan/5733752 to your computer and use it in GitHub Desktop.
Center the navigation horizontally - Tip 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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