Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frozen Postioning

Status
Not open for further replies.

magicandmight

IS-IT--Management
Aug 27, 2004
77
US
I wish to keep my menu bar and a footer in postion no matter where the user scrolls on my website. I wish to only use CSS and XHTML to do this. I used to know how to do this, but somehow I have lost this information.
 
How about judicioulsy applied DIVs.

something like:

Code:
<div id="menubar">
</div>
<div id="content">
</div>
<div id="footer">
</div>

And the CSS would be:
Code:
div#menu
{
    background-color: red;
    width: 165px;
    height: 80%;
    border: 0px;
    padding: 0px;
    float: left;
    overflow:auto;
}

div#content
{
    top:0px
    width: 100%;
    height: 80%;
    background-color: fuchsia;
    padding: 0px;
    overflow:scroll;
}
div#footer
{
    top:80%;
    left:0px;
    width: 100%;
    height: 20%;
    background-color: blue;
    padding: 0px;
    overflow:auto;
}
</style>
This creates 3 boxes. Menu and Footer will remain on spot, and the Content div has scrollbars to scroll through whatever you place there. while the menu and the footer stay visible at all times. The only caveat here is that it uses the div's scrollbar as opposed to the browser's scrollbar.

Firefox shows no scrollabr unless its needed, so it poses no major problem there as the only visible scrollbar will be the one for the content DIV. however IE will show a disabled scrollabr on the side. And that can be annoying to some users.

Other than that it works perfectly for what you want.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top