Make HTML content area fit to viewport height?

Posted by viatropos on Stack Overflow See other posts from Stack Overflow or by viatropos
Published on 2010-04-30T01:24:24Z Indexed on 2010/04/30 1:37 UTC
Read the original article Hit count: 355

Filed under:
|
|
|

I just made this demo extracting out what I'm trying to accomplish:

alt text

I want the pink/yellow area to act according to these rules:

  • Minimum height is the size of its content (which is variable) IF content size is smaller than viewport size
  • Otherwise minimum height is such that it adjusts to fill the window.

Checking out the source to that demo, what am I missing? I feel like this is a pretty easy case that shouldn't require javascript.

Any ideas?

© Stack Overflow or respective owner

Related posts about html

Related posts about position