Skip to content

Instantly share code, notes, and snippets.

@lukemartin
Created July 20, 2011 10:43
Show Gist options
  • Save lukemartin/1094751 to your computer and use it in GitHub Desktop.
Save lukemartin/1094751 to your computer and use it in GitHub Desktop.
CSS: Horizontally centre list items
ul {
float: left;
left: 50%;
margin: 0;
padding: 0;
position: relative;
}
ul li {
float: left;
left: -50%;
position: relative;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment