Hi rangana,
Thanks for your input ;-)
I removed the quirksmode and this helped.
I also checked my sizes as they had become incorrect with constant editing and lack of coffee, lol. This also helped.
The reason for using absolute positioning is that I want the
top and bottom frames always visible at the top and bottom of the browser window and the
bottom of the left\right frames to reach the top of the bottom frame.
With the way method you use, if the viewer goes to fullscreen (F11) then the bottom frame is no longer at the bottom.
I've included my amended code below which works the way I want apart from one thing..
I can't get the bottom of the left\right frames to exactly meet the top of the bottom frame dynamically.
I suppose I should be able to do this dynamically with javascript, using the document.documentElement.clientHeight or document.body.clientHeight values.
In the code I have deliberately made the top and bottom frames too short so you can see what I mean.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dynamic Drive: CSS Left, Top, Bottom and Right Frames Layout</title>
<style type="text/css">
body{
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
}
#frameLeft{
position: absolute;
top: 140px;
left: 0;
width: 150px; /*Width of left frame div*/
height: 100%;
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background-color: blue;
color: white;
}
#frameRight{
position: absolute;
top: 140px;
left: auto;
right: 0;
width: 150px; /*Width of right frame div*/
height: 100%;
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background-color: yellow;
color: white;
}
#frameTop{
position: absolute;
top: 0;
left: 10px;
width: 98%;
height: 140px; /*Height of top frame div*/
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background-color: red;
color: white;
}
#frameBottom{
position:absolute;
top: auto;
left:10px;
bottom: 0;
width:98%;
height: 70px; /*Height of bottom frame div*/
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background-color: green;
color: white;
}
#frameMiddle{
position: fixed;
top: 140px; /*Set top value to HeightOfTopFrameDiv*/
bottom: 70px; /*Set bottom value to HeightOfBottomFrameDiv*/
left: 150px; /*Set left value to WidthOfLeftFrameDiv*/
right: 150px; /*Set right value to WidthOfRightFrameDiv*/
overflow: auto;
background-color: gray;
}
* html body{ /*IE6 hack*/
padding: 140px 150px 70px 150px; /*Set value to (HeightOfTopFrameDiv WidthOfRightFrameDiv HeightOfBottomFrameDiv WidthOfLeftFrameDiv)*/
}
* html #frameMiddle{ /*IE6 hack*/
height: 100%;
width: 100%;
}
* html #frameTop, * html #frameBottom{ /*IE6 hack*/
width: 100%;
}
</style>
</head>
<body>
<div id="frameLeft">
left frame
</div>
<div id="frameRight">
<h3>Sample text here</h3>
</div>
<div id="frameTop">
Sample
</div>
<div id="frameBottom">
<h3>Sample text here</h3>
</div>
<div id="frameMiddle">
<h1>Dynamic Drive CSS Library</h1>
middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />middle<br />
</div>
</body>
</html>
Bookmarks