Since IE doesn't support position:fixed properly, it's difficult to add a title/top bar at the top of the screen but have all the rest of the content on the page scrollable using the main scrollbars. If you have a solution to make IE respect this (ver 6 and up) I'd appreciate it.
However, I figured I could achieve as good an effect by switching what I was targeting. Instead of fixing the top in place and letting the rest of the content exceed the browser window as necessary (creating a scrollbar), I thought I'd put the long content in a div with overflow:auto, and make the div never exceed the browser height. Now I have a scrollbar in the div but no scrollbar on the main page. It's not exactly the same, but very close. In some ways, it could be considered superior for certain uses because now I can style the div to make it appear to be inset as part of a larger form, and also the scrollbar doesn't extend into the area of the title bar.
The problem is, I so far haven't been able to figure out how to get a div that extends to the bottom of the browser viewport and yet can be pushed downward by the titlebar (say if the user changes the font size).
Starting with that, let me try to explain again: the first div should stay at the top of the screen, and the second div should fill all the way to the bottom of the browser window. The second div should begin immediately after the bottom of the upper one no matter how the upper one's size changes.
Either the browser window should have a scrollbar which scrolls the second div's content but the top div remains fixed (feel free to remove any markup entirely or nest anything however you please), OR the browser window should not gain a scrollbar at any time but the 2nd div should have only a vertical scrollbar when the content is higher than its displayed size.
[tt]|---Browser Viewport----|
| |-------------------| [COLOR=black gray]^[/color]
| | Title Bar Content | [COLOR=black #e0e0e0]|[/color]
| | fixed position | [COLOR=black #e0e0e0]|[/color]
| | can change v-size | [COLOR=black #e0e0e0]|[/color]
| |-------------------| [COLOR=black #e0e0e0]|[/color]
| [COLOR=black #e0e0e0]|[/color]
| Main Content [COLOR=black #e0e0e0]|[/color]
| which [COLOR=black #e0e0e0]|[/color]
| runs [COLOR=black #e0e0e0]|[/color]
| off [COLOR=black #e0e0e0]|[/color]
| the [COLOR=black #e0e0e0]|[/color]
| screen below [COLOR=black gray]v[/color]
|-----------------------|[/tt]
OR
[tt]|---Browser Viewport----|
| |
| Title Bar Content |
| fixed position |
| but can change size |
| |-------------------| |
| |Main Content [COLOR=black gray]^[/color] |
| |which [COLOR=black #e0e0e0]|[/color] |
| |runs [COLOR=black #e0e0e0]|[/color] |
| |out of [COLOR=black #e0e0e0]|[/color] |
| |this div, below [COLOR=black gray]v[/color]
| |-------------------| |
|-----------------------|[/tt]
However, I figured I could achieve as good an effect by switching what I was targeting. Instead of fixing the top in place and letting the rest of the content exceed the browser window as necessary (creating a scrollbar), I thought I'd put the long content in a div with overflow:auto, and make the div never exceed the browser height. Now I have a scrollbar in the div but no scrollbar on the main page. It's not exactly the same, but very close. In some ways, it could be considered superior for certain uses because now I can style the div to make it appear to be inset as part of a larger form, and also the scrollbar doesn't extend into the area of the title bar.
The problem is, I so far haven't been able to figure out how to get a div that extends to the bottom of the browser viewport and yet can be pushed downward by the titlebar (say if the user changes the font size).
Code:
<div><h1>title bar content</h1>
<ul><li>multiple lines</li>
<li>could change vertical size through user font size changes</li></ul>
</div>
<div style="overflow:auto;margin:5px;padding:5px">
main content, very long, exceeds screen, only want vertical scrollbar and no horizontal scrollbar. Would be nice if it had margins of 5px all around and if I could style it, perhaps with nested divs as if it was an inset text box.
</div>
Either the browser window should have a scrollbar which scrolls the second div's content but the top div remains fixed (feel free to remove any markup entirely or nest anything however you please), OR the browser window should not gain a scrollbar at any time but the 2nd div should have only a vertical scrollbar when the content is higher than its displayed size.
[tt]|---Browser Viewport----|
| |-------------------| [COLOR=black gray]^[/color]
| | Title Bar Content | [COLOR=black #e0e0e0]|[/color]
| | fixed position | [COLOR=black #e0e0e0]|[/color]
| | can change v-size | [COLOR=black #e0e0e0]|[/color]
| |-------------------| [COLOR=black #e0e0e0]|[/color]
| [COLOR=black #e0e0e0]|[/color]
| Main Content [COLOR=black #e0e0e0]|[/color]
| which [COLOR=black #e0e0e0]|[/color]
| runs [COLOR=black #e0e0e0]|[/color]
| off [COLOR=black #e0e0e0]|[/color]
| the [COLOR=black #e0e0e0]|[/color]
| screen below [COLOR=black gray]v[/color]
|-----------------------|[/tt]
OR
[tt]|---Browser Viewport----|
| |
| Title Bar Content |
| fixed position |
| but can change size |
| |-------------------| |
| |Main Content [COLOR=black gray]^[/color] |
| |which [COLOR=black #e0e0e0]|[/color] |
| |runs [COLOR=black #e0e0e0]|[/color] |
| |out of [COLOR=black #e0e0e0]|[/color] |
| |this div, below [COLOR=black gray]v[/color]
| |-------------------| |
|-----------------------|[/tt]