CSS ALIGN VERTICAL
.top-align {
vertical-align: top;
}
.center-align {
vertical-align: middle;
}
k-vernooy
.top-align {
vertical-align: top;
}
.center-align {
vertical-align: middle;
}
margin-top: auto;
margin-bottom: auto;
/*
For a flexed item you can you align - items to center content vertically
you can use justify content to center horizontally
*/
.container {
display: flex;
align-items: center;
justify-content: center;
}
.container{
display: table;
}
.div-inside-container{
display: table-cell;
vertical-align: middle;
}
<div style="display: table; height: 400px; overflow: hidden;">
<div style="display: table-cell; vertical-align: middle;">
<div>
everything is vertically centered in modern IE8+ and others.
</div>
</div>
</div>