Log in

View Full Version : CSS Top Frame Layout



bernie
03-28-2007, 03:18 PM
URL:http://www.dynamicdrive.com/style/layouts/item/css-top-frame-layout/

Can anyone help me to adjust the maincontent top margin section so that it does not dissappear behind the static "frame" when resized.

I've tried seeting position to None and top to 280px but it remains "fixed"


#maincontent{
position: none;
top: 280px; /*Set top value to HeightOfFrameDiv*/
left: 0;
right: 0;
bottom: 0;
overflow: auto;
background: #fff
}

Veronica
03-29-2007, 12:17 AM
The position for maincontent has to stay fixed, otherwise it will go behind the frame.

If you want to adjust the frame and content to make more room for content, you would change the numbers for both height of framecontent and top of maincontent, keeping them equal.



#framecontent{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100px; /*Height of frame div*/
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background-color: navy;
color: white;
}


#maincontent{
position: fixed;
top: 100px; /*Set top value to HeightOfFrameDiv*/
left: 0;
right: 0;
bottom: 0;
overflow: auto;
background: #fff;
}