Last active
December 16, 2015 19:50
-
-
Save achudars/5488041 to your computer and use it in GitHub Desktop.
Perfectly centered DIV using CSS.
Perfectly centred DIV using 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 { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
width: 400px; | |
height: 400px; | |
margin-left: -200px; | |
margin-top: -200px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment