I had some trouble getting the fake frames for the original layout I had created for this site. I needed to change the layout and make it simpler to get the frames to work. Frames are created with div-tags as the basic tableless layout. I created 5 different classes for 5 div-tags to build up a basic layout. My stylesheet code for the layout looks like this :
#header{
position: fixed;
top: 0;
left: 0;
height: 30%;
width: 80%;
background: #FAFFFF;
}
#pagewidth{
position: fixed;
overflow: auto;
width: 80%;
height: 65%;
top: 35%;
left: 0;
padding: 0;
margin: 0;
}
#footer{
position: fixed;
width: 80%;
height: 5%;
}
#leftcol{
width: 30%;
position: relative;
float: left;
background-color: #D9D4B7;
margin: 0;
text-align: left;
}
#maincol{
width: 70%;
position: relative;
background-color: #FAFFFF;
margin: 0;
float: right;
text-align: left;
}
The header, pagewidth and footer classes creates the frames. I use the position property with the value fixed to position my frames on the page. For the frame that should have the scrollbar I added the overflow property with the auto value (the red part of the above code). You can find more information on the position property here and the overflow property here. The leftcol and maincol classes create a sidebar and a main content area for the posts in the pagewidth frame.
You’ll find an example of the frames in my test blog. I haven’t tested the frames in all possible browsers, so I guess there is probably one or two browsers around where this doesn’t work.
Header Header Header Header
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth Pagewidth
Footer