Code: Select all
<div class="parent">
<div class="children">I'm vertically centered!</div>
</div>
Code: Select all
.children{
background: #ffdb4c;
height: 300px;
position: relative;
top: 50%;
transform: translateY(-50%);
}
credit : http://davidwalsh.name/css-vertical-center