position the element vertical center with pure CSS skill from Front-End Developer Taiwan Group
Created
June 1, 2014 04:00
-
-
Save kpman/c7b764a1ad0eedea57cc to your computer and use it in GitHub Desktop.
A Pen by kpman.
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
div { | |
margin: auto; | |
width: 100px; | |
height: 100px; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
position: absolute; /* important */ | |
background: DodgerBlue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment