Reputation: 19651
Take a look :
Result should be
Upvotes: 21
Views: 8638
Reputation: 6669
Actually using css flex display can solve this easily.
Set the parent container to have
display: flex;
align-items: stretch;
align-content: stretch;
Then the children will have flex-grow: 0;
Make the last child have flex-grow: 1;
Put #sidebar
and #post_box
in #content
and then
#content { display:flex; align-items: stretch; align-content: stretch; }
#sidebar { float:left; width:280px; flex-grow: 0; }
#post_box { float: left; flex-grow: 1; }
Upvotes: 2
Reputation: 186762
#sidebar { float:left; width:280px; }
#content { margin: 0 0 0 280px; } /* dont float it */
You will have problems if you have floats inside of #content and you try to clear them, though.
Upvotes: 20