I've established a simple layout
<div class="container">
<div class="sidebar">
</div>
<div class="content">
</div>
<div style="clear:both;"></div>
</div>
where .sidebar
and .content
are styled with float: left
I have searched through numerous responses on S.O., but they all seem to work ONLY IF the .content
does not exceed the screen size. To emphasize my issue, I present two examples:
http://jsfiddle.net/pleasedontbelong/h35vc/2/ (small content) http://jsfiddle.net/pleasedontbelong/56C9v/1/ (big content)
When the .content
div is too large, the height:100%
property in the container fails to function.
In both scenarios, the gray div should fill 100% of the height. It appears that the browser computes the window height prior to floating the elements.
Is there a CSS-only solution to this problem? (I could resort to JS, but it feels unclean)