CSS Vertical Align Div with CSS Table and Flexbox

Glenn Glenn's Blog 0 Comments

A straightforward approach with CSS Table This approach has been around for ages, but is still rarely used over absolute div positioning. We simply add CSS table to the parent div and table-cell to the child div to be centred:- [css] .vertical-container { display: table; } .vertically-centered { display: table-cell; vertical-align: middle; margin: auto; /* optional */ float: none; /* optional */ …