Reputation: 2243
I have this:
<div class="one">
<h2>Title that can be quite long and I don't know it's height</h2>
<div class="two">Content that can overflow and that needs to be scrolled (but the title needs to remain up so that won't scroll</div>
</div>
And this CSS:
.one{height: 250px; width: 120px;}
.two{overflow:auto;}
But I can't get .two to do the scroll. I don't know the height of .two or h2. Also I only want .two to do the scroll.
Upvotes: 2
Views: 3265
Reputation: 2052
I've made the http://jsfiddle.net/zm8Lj/ for you. Please take a look.
Upvotes: 3
Reputation: 1720
You have to specify an heigth for two
.
Calculate the div.two
height depending on the h2
height.
$('div.two').height($('div.one').height()-$('h2').height());
See it in action : http://jsfiddle.net/FQwbG/
Upvotes: 1
Reputation: 374
If you wan't your title don't move from top, wrap it with div and give it position: fixed; top: 0px; lwft: 0px;
Upvotes: 0