I\'m trying to create a website where the pages resize to the windows size on the fly. While we can get images and such to resize automatically as a % of the div size. We do
How about using media queries?
So you can use screen.availHeight to calculate a constant value which you can multiply with the font size.
window.onload = function () {
document.body.style.fontSize = (Math.ceil(screen.availHeight * parseInt(document.body.style.fontSize) / 600) + 'px';
}
even use % for text. http://w3schools.com/cssref/css_units.asp
Whipped up some example to adjust font-size on div size change. Using percentage in the parent div and adjusting the font-size there should do the trick.
http://jsfiddle.net/744A2/