Last active
August 29, 2015 13:56
-
-
Save maxivak/9132899 to your computer and use it in GitHub Desktop.
CSS examples
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 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