Im having an (small) problem. Im trying to give my menu bar’s background color, the same height as my main content div, So i thought Ill give the div an 100% height, but that doesnt seem to work since there is not more content to make the div’s height higher,
I have made an example, (made in jsfiddle) with my meaning. I know this is possible, since i’ve done this before. Its an kinda easy question, but you have those days that you littarly forget anything.
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<div id="wrapper">
<div id="boxLeft">
menu1 </br>
menu2 </br>
menu3 </br>
</div>
<div id="boxMid">
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
Lorem ipsum <br />
</div>
<div id="boxRight">
</div>
</div>
</body>
</html>
*{color:white;}
#wrapper{height:100% width:100%;}
#boxLeft{float:left; width:100px; height:100%; background-color:gray;}
#boxMid {float:left; width:400px; height:100%; background-color:blue; }
#boxRight{float:left; width:200px; height:50px; background-color:orange;}
Thanks for reading,
take a look at:
Equal height columns
hope this help u. By the way you could use jquery to fix the height whem dom is ready.
To make your wrapper the correct height use the following:
With the css trick clear:both thre wrapper heights gets the max height of his children.