In a single HTML page I have a section at the top that I want to remain in
place while the rest of the content scrolls. Most importantly, I don't want
the scrollbar to be drawn in the top sectiob. The effect I'm looking for is
the same as frames but without using frames.
I have tried a <div style="overflow:auto"> for the bottom section - this
gives the right effect but only if the height of the div is specified
explicitly. I want the div to take up all the remaining space in the window.
I have also tried to position the top section with absolute positioning but
it still seems to scroll with the bottom section.
any clues please? I'm sure there must be a simple solution
TIA
Andy
Posted by Rijk van Geijtenbeek on October 15, 2004, 1:31 pm
Please log in for more thread options
wrote:
> Dear HTML gurus
>
> In a single HTML page I have a section at the top that I want to remain
> in place while the rest of the content scrolls. Most importantly, I
> don't want the scrollbar to be drawn in the top sectiob. The effect I'm
> looking for is the same as frames but without using frames.
>
> I have tried a <div style="overflow:auto"> for the bottom section - this
> gives the right effect but only if the height of the div is specified
> explicitly. I want the div to take up all the remaining space in the
> window.
'remaining window space' is not a very CSS-friendly concept.
> I have also tried to position the top section with absolute positioning
> but it still seems to scroll with the bottom section.
Easy enough with CSS 2, if only MSIE would support it:
[div class=top] top stuff [/div]
[div class=other] other stuff [/div]
You can get MSIE 6 to do something that works the same, and falls back OK
in MSIE 5:
see http://devnull.tagsoup.com/fixed/
--
Rijk van Geijtenbeek
The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Posted by Andy Fish on October 15, 2004, 1:37 pm
Please log in for more thread options
> wrote:
>
>> Dear HTML gurus
>>
>> In a single HTML page I have a section at the top that I want to remain
>> in place while the rest of the content scrolls. Most importantly, I
>> don't want the scrollbar to be drawn in the top sectiob. The effect I'm
>> looking for is the same as frames but without using frames.
>>
>> I have tried a <div style="overflow:auto"> for the bottom section - this
>> gives the right effect but only if the height of the div is specified
>> explicitly. I want the div to take up all the remaining space in the
>> window.
>
> 'remaining window space' is not a very CSS-friendly concept.
>
>> I have also tried to position the top section with absolute positioning
>> but it still seems to scroll with the bottom section.
>
> Easy enough with CSS 2, if only MSIE would support it:
>
> [div class=top] top stuff [/div]
> [div class=other] other stuff [/div]
>
> body {margin:0; padding: 0;}
> div.top {position: fixed; height: 5em; top: 0; left: 0; right: 0;}
> div.other {margin-top: 5em;}
>
>
> You can get MSIE 6 to do something that works the same, and falls back OK
> in MSIE 5:
> see http://devnull.tagsoup.com/fixed/ >
Thanks for the quick reply. Unfortunately this doesn't seem to really do
what I want.
in both the standard version and the IE version, the top stuff seems to be
floating over the other stuff, so the scrollbar is the full height of the
window and scrolls the other stuff underneath (in z order) the top stuff.
I'm trying to achieve something that looks the same as a frame, so the
scrollbar is only the height of the other stuff
Andy
> --
> Rijk van Geijtenbeek
>
> The Web is a procrastination apparatus:
> It can absorb as much time as is required to ensure that you
> won't get any real work done. - J.Nielsen
>