I am trying to align my text to the bottom of div. Normally this is pretty straight forward when using fixed sizes for my divs. I ma trying something new with percentages and the vertical align doesn't seem to work at all.
$(document).ready(function(e) {
var mh = parseInt($('#map').height());
var h = 70 - ((20/mh)* 100);
document.getElementById('map').style.height = h + "%";
});
#map{
width:95%;
height:70%;
background-color:#F00;
}
<div id="home_header" style="display:table-cell; vertical-align:bottom; width:90%; height:30%;">
<h1>There is currently <?php echo $a; ?> users playing worldwide at the moment.</h1>
</div>
<div id="map"></div>
I do know that this can be done with fixed sizes, I have done i before and seen it done a few times. Heres 1 example. Not sure why this doesn't work is a case of I have to use fixed sizes for the divs or is there another way?
UPDATE- this method does work for fixed sizes, eg 100px;