Last active
November 13, 2016 04:46
-
-
Save spac3unit/de2a02ec115e5a8d32ee1d965061805f to your computer and use it in GitHub Desktop.
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 class="container"> | |
<div>Hello</div> | |
</div> | |
////////* 1st method *//////// | |
.container{ //Body can be used | |
display:flex; | |
height:100vh; | |
align-items: center; | |
justify-content: center; | |
} | |
body { | |
margin: 0 auto; // Removes the scroll bar | |
} | |
////////* 2nd method *//////// | |
.container { | |
display: flex; | |
position: absolute; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
top: 0; | |
overflow: hidden; | |
div { | |
align-self: center; | |
margin: auto; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment