tags:

views:

135

answers:

2

Hi, if have the following code:

<div id="container" style="position:relative; width:300px; height:300px; overflow:scroll;">
    <div id="header">
    </div>
    <div>
    a table of contents
    </div>
</div>

how do i make the inner div with the id "header" follows when i scroll down the outer div "container"? TIA Lina

+1  A: 

Put the header outside of the container. It's useless to let it in since you don't want to display it inside.

remi bourgarel
i have to display it inside, as i have something like this:<form>radio button 1, radio button 2, radio button 3</form><div id="container"> <div id="header"> <table>calendar</table> </div> <div> <table> a lot of rows </table> </div></div>when radio button 1 is chosen then calendar is all days in a year,radio button 2, calendar is only months of the year,radio button 3, calendar is only yearand the contents depend also on that, so i have to include it inside the big container
Lina
A: 

I found the answer to exactly what i want to do here: http://www.cubido.at/Default.aspx?tabid=176&amp;EntryID=8 although i thought the answer is going to be simpler, but seems that css alone won't fix it, although it would be very helpful to have something like "position: fixed;" that works not only relative to page but to containing element...

Lina