Ok guys and birds, thatβs what I ended up doing. Instead of solving the problem directly, I added a few fixers.
First of all, here are a few notes:
We know that when #column
longer than the viewport, the length of #column
must indicate the height of the <body>
.
If #column
shorter than the viewport, the height of the viewport should indicate the height of the <body>
.
The column should stretch to the bottom of the page under any circumstances, no matter how long the content is.
For the first criteria, we need to make sure that height: auto
set to <body>
. Height
defaluts if it is not installed. We also need to make sure #column
has height: auto;
and overflow: hidden;
so that it expands to the size of its contents.
For the second criterion, we need to set position: absolute;
and min-height: 100%;
on <body>
. Now the length of the <body>
will expand if the #column
larger than it, but not smaller than the viewport. This next part contains a fix.
For the third criterion, the trick is to add extra divs and give them special css. In my HTML, I added two #column
right outside of #column
.
<div id="colhack-outer"> <div id="colhack-inner"> </div> </div> <div id="column"> ... </div>
For an external div, you set it absolutely and set it to a height of 100%, forcing it to use an alternative window model and moving its content area using the pad. You apply all your column style (background color, border radius, shadow, etc.) to the inner div. Here is the CSS that I applied to them:
#colhack-outer { height: 100%; padding: <where you want to shift the column to>; position: absolute; width: 50%; } #colhack-inner { height: 100%; width: 100%; background-color: #303030; }
You should also use the container of actual content in this special box and move it with the addition:
#contentbox { position: relative; padding: <where you want to shift the column to>; width: 50%; color: #EEEEEC; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
Here's a live example: http://nerdhow.net/
post a comment if you have questions or something is unclear.