PDA

View Full Version : div and css to create a page with auto height



stianstian
Apr 17th, 2009, 12:13 PM
Hi. I'm having trouble getting the height on my site to be automatic. I've tried a lot of different approaches but they all end up misplacing my columns. So for now i have a fixed height. Can you look at this code and tell me how to fix so that the height of the site becomes automatic. Thanks.
This is the CSS code:


#header {
border: 1px solid black;
margin: 0 auto;
height: 120px;
background-image: url(babed2.png);
}
#index {
height: 99%;
width: 99%;
display: block;
}


#side {
width: 780px;
background-color: #009933;
border: 1px solid black;
margin: 0 auto;
height: 600px;
}
#leftmenu {
background-color: #009933;
height: auto;
width: 20%;
float: left;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: large;
color: #99FF99;
text-align: center;
}
#content {
background-color: #009933;
height: auto;
width: 79%;
float: right;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: small;
}
#footer {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #0033FF;
background-color: #009933;
text-align: center;
height: 20px;
width: 780px;
margin: 0 auto;
border: 1px solid black;
}

And this is the HTML code:


<div id="side">
<div id="header"> <a id="index" href="index.html"> </a></div>
<div id="leftmenu">
<p><a href="index.html"> Hjem </a></p>
</div>
<div id="content">
content goes here..
</div>
</div>
<div id="footer"> footer </div>

abduraooft
Apr 17th, 2009, 12:28 PM
Can you look at this code and tell me how to fix so that the height of the site becomes automatic. automatic? Anyway check http://bonrouge.com/2c-hf-fluid.php