Kim2
11-12-2008, 03:28 PM
Im trying to create a layout as shown below, but Im having problems when the content in "MAIN" is longer than 100% (near X). The column with the logo simply does not stretch. Using "position: fixed" solves it, but I dont want the logo to stay on top. The background color should be shown when the user scrolls down.
Its split into two colums, where the left one has a fixed width and the right is fluid. The right column is split into four rows, where row 1,2 and 4 have fixed heights - making row 3 fluid. No rows have fixed positions.
What have I done wrong, or is missing ?
Layout
| | Topbar |
|L|---------|
|O| Menu |
|G|---------|
|O| |
| | M A I N |
| | |
| |---------|
|X| Footer |
HTML
<div id="container">
<div id="leftCol">
<div id="logo"></div>
</div>
<div id="rightCol">
<div id="info"></div>
<div id="menu"></div>
<div id="content">Content</div>
<div id="footer">Footer</div>
</div>
</div>
CSS
html,body{
margin:0;
padding:0;
width: 100%;
height: 100%;
min-height: 100%;
}
/* LAYOUT */
div#container{
width: 100%;
height: 100%;
min-height: 100%;
float: left;
}
div#leftCol{
width: 43px;
height: 100%;
min-height: 100%;
float: left;
margin-right: 10px;
}
div#rightCol{
padding-left: 53px;
margin-right: 5px;
}
div#logo{
height: 100%;
min-height: 100%;
background-image: url('/images/logo.jpg');
background-repeat: no-repeat;
}
div#topbar{
margin-left: -10px; /*strech to touch #leftcol*/
margin-bottom: 5px;
padding: 5px 0px 5px 25px; /* top right bottom left */
display: block;
height: 15px;
line-height: 15px;
border-bottom: 1px solid gray;
background: InfoBackground url('/images/image.gif') no-repeat 6px 4px;
font: message-box;
color: InfoText;
overflow: hidden;
z-index: 1;
}
div#menu{
height: 20px;
margin-top: 5px;
border-bottom: 1px solid black;
}
div#content{
height: 100%;
margin-top: 10px;
margin-bottom: 10px;
}
div#footer{
height: 20px;
}
Its split into two colums, where the left one has a fixed width and the right is fluid. The right column is split into four rows, where row 1,2 and 4 have fixed heights - making row 3 fluid. No rows have fixed positions.
What have I done wrong, or is missing ?
Layout
| | Topbar |
|L|---------|
|O| Menu |
|G|---------|
|O| |
| | M A I N |
| | |
| |---------|
|X| Footer |
HTML
<div id="container">
<div id="leftCol">
<div id="logo"></div>
</div>
<div id="rightCol">
<div id="info"></div>
<div id="menu"></div>
<div id="content">Content</div>
<div id="footer">Footer</div>
</div>
</div>
CSS
html,body{
margin:0;
padding:0;
width: 100%;
height: 100%;
min-height: 100%;
}
/* LAYOUT */
div#container{
width: 100%;
height: 100%;
min-height: 100%;
float: left;
}
div#leftCol{
width: 43px;
height: 100%;
min-height: 100%;
float: left;
margin-right: 10px;
}
div#rightCol{
padding-left: 53px;
margin-right: 5px;
}
div#logo{
height: 100%;
min-height: 100%;
background-image: url('/images/logo.jpg');
background-repeat: no-repeat;
}
div#topbar{
margin-left: -10px; /*strech to touch #leftcol*/
margin-bottom: 5px;
padding: 5px 0px 5px 25px; /* top right bottom left */
display: block;
height: 15px;
line-height: 15px;
border-bottom: 1px solid gray;
background: InfoBackground url('/images/image.gif') no-repeat 6px 4px;
font: message-box;
color: InfoText;
overflow: hidden;
z-index: 1;
}
div#menu{
height: 20px;
margin-top: 5px;
border-bottom: 1px solid black;
}
div#content{
height: 100%;
margin-top: 10px;
margin-bottom: 10px;
}
div#footer{
height: 20px;
}