Skip to content

Instantly share code, notes, and snippets.

@matthewstokeley
Created November 30, 2018 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewstokeley/7dae3f57d2aa75cc64b8b4ea58f065bf to your computer and use it in GitHub Desktop.
Save matthewstokeley/7dae3f57d2aa75cc64b8b4ea58f065bf to your computer and use it in GitHub Desktop.
<!-- 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