Created
December 24, 2016 14:18
-
-
Save YeomanYe/dd9492c0d5e08253390077ce5a881cfe to your computer and use it in GitHub Desktop.
CSS:layout halignCenterByVh
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
/*只适用与在视口中居中的场景*/ | |
main { | |
width: 18em; | |
padding: 1em 1.5em; | |
margin: 50vh auto 0; | |
transform: translateY(-50%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment