Skip to content

Instantly share code, notes, and snippets.

@gpassarelli
Created March 20, 2012 12:42
Show Gist options
  • Save gpassarelli/2134845 to your computer and use it in GitHub Desktop.
Save gpassarelli/2134845 to your computer and use it in GitHub Desktop.
CSS: Horizontal Centered List
#centeredmenu {
float:left;
width:100%;
overflow:hidden;
position:relative;
}
#centeredmenu ul {
clear:left;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
left:50%;
text-align:center;
}
#centeredmenu ul li {
display:block;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
right:50%;
}
#centeredmenu ul li a {
display:block;
padding:0 10px;
text-decoration:none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment