Equal top and bottom padding
<div id="parent">
  <div id="child">Content here</div>
#parent {padding:  5% 0;}
#child  {padding: 10% 0;}

Equal top and bottom paddings are used to center the child div within the parent div and also to center the text inside the child div.

The paddings have all been set in % to allow both divs to grow dynamically.

If the height of any element is set with absolute measurements some math would be required to ensure padding equality on top and bottom.

While this method sets paddings on the containers you could instead flip things and set margins on the elements being contained.

Note: Additional styles not related to the above have been used to make this demo more presentable.