-
-
Save cassianorabelo/5090163 to your computer and use it in GitHub Desktop.
How to shrinkwrap and center elements horizontally
http://www.456bereastreet.com/archive/201303/how_to_shrinkwrap_and_center_elements_horizontally/
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
<div> | |
<ul> | |
<li><a href="#">Lorem</a></li> | |
<li><a href="#">Aliquam</a></li> | |
<li><a href="#">Vestibulum</a></li> | |
</ul> | |
</div> |
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
* { | |
margin:0px; | |
padding:0px; | |
} | |
div { | |
text-align:center; | |
} | |
ul { | |
display: inline-block; | |
list-style:none; | |
background-color:orange; | |
margin:20px; | |
padding:20px; | |
border-radius:12px; | |
} | |
li { | |
float:left; | |
margin:0px; | |
} | |
li + li { | |
margin-left:20px; | |
} | |
a { | |
-webkit-transition: all 0.5s; | |
transition: all 0.5s; | |
color:white; | |
display:block; | |
text-decoration:none; | |
padding:10px 15px; | |
background-color:grey; | |
border-radius:12px; | |
} | |
a:hover { | |
color:black; | |
background-color:red; | |
border-radius:6px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment