Created
December 8, 2013 01:19
-
-
Save crixlet/7852213 to your computer and use it in GitHub Desktop.
center UL list horizontally From http://css-tricks.com/centering-list-items-horizontally-slightly-trickier-than-you-might-think/
This file contains hidden or 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
This isn't very hard. Just give the list centered text (e.g. ul.nav { text-align: center; }) and the list items inline-block (e.g. ul.nav li { display: inline-block; }). If you want to do it with margin for whatever reason, look into width: fit-content; (link). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment