Created
August 11, 2013 20:11
-
-
Save lanche86/6206660 to your computer and use it in GitHub Desktop.
Absolute Horizontal And Vertical Centering In CSS
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> | |
I am Horizontal and Vertical centered only by CSS! | |
</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 Full documentation on: http://codepen.io/shshaw/full/gEiDt */ | |
div { | |
background: red; | |
height: 100px; | |
width: 100px; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
margin: auto; | |
position: absolute; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment