469,312 Members | 2,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,312 developers. It's quick & easy.

scrolling only part of a window

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.

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
Jul 23 '05 #1
2 5910
On Fri, 15 Oct 2004 09:57:20 GMT, Andy Fish <aj****@blueyonder.co.uk>
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/

--
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

Jul 23 '05 #2

"Rijk van Geijtenbeek" <ri**@operaremovethiz.com> wrote in message
news:op**************@news.individual.net...
On Fri, 15 Oct 2004 09:57:20 GMT, Andy Fish <aj****@blueyonder.co.uk>
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

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Midas NDT Sales | last post: by
4 posts views Thread by mr_burns | last post: by
3 posts views Thread by Vikram Bhatia | last post: by
14 posts views Thread by Dave | last post: by
2 posts views Thread by James CC | last post: by
4 posts views Thread by Keith Bentrup | last post: by
3 posts views Thread by Chamnap | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.