I have an HTML page layout - something like this:
<div id='header'>
Header content
</div>
<div id='main_content'>
some content
</div>
The content in the #main_content div may be really long, or, next to nothing (i use it as part of a template across an entire site).
What I want is for it to minimally be the height of the viewport (minus the height of the header div above that - but no need to get that value, lets just use 100px for sake of discussion).
I can't seem to do this via pure CSS. However, I was thinking perhaps I can fire off a Javascript function every 1 second (and presumably fire it off on the resize event as well), check the height of #main_content, and if its not at least (viewport_hight - 100), then set it to be (viewport_height -100).
Problem is, I am not sure if this is do-able, and, not sure if there is a 'better way'.
Has anyone faced this issue and have a great solution?
Thanks.