Created
November 30, 2018 19:11
-
-
Save matthewstokeley/7dae3f57d2aa75cc64b8b4ea58f065bf 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
<!-- vertically-aligned center and bottom boxes in a column with flex box --> | |
<div class="container"> | |
<div class="center"> | |
<span>center</span> | |
</div> | |
<div class="bottom"> | |
<span>bottom</span> | |
</div> | |
</div> | |
.container { | |
height: 100vh; | |
border: 1px solid #000; | |
display: flex; | |
flex-flow: column; | |
align-items: center; | |
width: 100%; | |
} | |
.center, .bottom { | |
border: 1px solid #dadada; | |
text-align: center; | |
font-family: serif; | |
font-size: 0.8rem; | |
display: flex; | |
justify-content: center; | |
align-items: flex-end; | |
height: 50%; | |
width: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment