As mentioned in my comment above, the W3C specifications will not allow containers to scroll when the height is not specified, because the internal height of the container will be used to determine its total height. If using a bit of JS code is an option, look at the following script:
http://jsfiddle.net/Moonbird_IT/kf3vD/
Here is my HTML structure that I used in the demo:
<div id="main"> <div id="main-column">...</div> <div id="side-bar"> <div id="side-bar-header"> Sidebar Header </div> <div id="side-bar-scroller"> <ul> <li>Option 1</li> <li>Option 2</li> <li>Option 3</li> <li>Option 4</li> <li>Option 5</li> <li>Option 6</li> <li>Option 7</li> <li>Option 8</li> <li>Option 9</li> <li>Option 10</li> <li>Option 11</li> <li>Option 12</li> </ul> </div> </div>
When the document is fully loaded, the height information of the left element (the main content element) will be used to set the height of the scroll element inside the side panel minus the height required to display the title of the side panel.
The essential part will be this short jQuery instruction:
$(document).ready(function() { var mainHeight=$('#main-column').height(); var sidebarHeaderHeight=$('#side-bar-header').height(); $('#side-bar-scroller').css('height', mainHeight-sidebarHeaderHeight); });โ
I tested the code only in Chrome, so you definitely need to tweak it a bit :-)
SaschaM78
source share