<div class="holder">
<div class="content">
I will be vertically aligned. Hooray!
</div>
</div>
.holder{
display: flex;
flex-direction: column;
/* This centers content vertically */
justify-content: center;
/* This centers content horizontally, think 'text-align:center' */
align-items: center;
/* Just giving this div a height and a background color as an example */
background-color:#EFEFEF;
height:200px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.