Skip to content

Instantly share code, notes, and snippets.

@maxivak
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxivak/9132899 to your computer and use it in GitHub Desktop.
Save maxivak/9132899 to your computer and use it in GitHub Desktop.
CSS examples
/*
center align ul inside DIV
*/
<div id="menu">
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</div>
.menu {
width:300px;
text-align: center; /*Set a width and text-align on the main div*/
}
.menu ul{
margin:0;
padding:0;
display:inline-block;
list-style: none; /*Set display to inline-block to the ul*/
}
.menu ul li {
float: left;
margin-right: 1.3em; /*this is the usual*/
padding: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment