Created
June 5, 2012 04:39
-
-
Save iamstarkov/2872671 to your computer and use it in GitHub Desktop.
centering with absolute position
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
/** | |
* centering with absolute position | |
*/ | |
div { | |
width: 100px; | |
height: 100px; | |
background-color: red; | |
position: absolute; | |
top:0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
margin: auto; | |
} |
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></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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment