Skip to content

Instantly share code, notes, and snippets.

@HarryAdney
Last active February 22, 2020 11:41
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 HarryAdney/629351ebfeb58d1d7d115ab6ef621f74 to your computer and use it in GitHub Desktop.
Save HarryAdney/629351ebfeb58d1d7d115ab6ef621f74 to your computer and use it in GitHub Desktop.
Vertical align with flex
Vertical align with flex
***html***
parent {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100wh;
}
.child {
width: 100px;
height: 100px;
background-color: #20126f;
}
***css***
<div class="parent">
<div class="child"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment