5

Helllo guys! I want to make my left menu with a 100% height.

There will be a content area on the right side and a footer just on the right side too.

I want the lightblue menu on left to reach the bottom 0 of the page.

Check this JSFiddle http://jsfiddle.net/mYw72/

Or this code!

        <div id="container">
        <div id="top">
            <div id="logo"></div>
            <div id="user-tools">
                <a href="#">Help</a>
                <span>&nbsp;|&nbsp;</span>
                <a href="#">Contact us</a>
            </div>
        </div>

        <div id="sidebar">
            <ul>
                <li><a href="#">Company</a></li>
                <li><a href="">Administrator</a></li>
                <li><a href="#">App</a></li>
                <li><a href="#">Configuration</a></li>
                <li><a href="#">Statistics</a></li>
                <li><a href="#">Monitor</a></li>
                <li><a href="#">Preference</a></li>
            </ul>
        </div>
        <div id="rightSide">
            <div id="content">
                Content.
            </div>

            <div id="bottom1">
                <div id="line-bottom"></div>
                <div id="text-bottom">Copyright 2012 <span>ME</span>, Inc. All Rights Reserved</div> 
            </div>
        </div>
    </div>

The css is something like this

html { 
padding:0px;
margin:0px;
}

body {
background-color: #ECEDEF;
font-family: Verdana, Tahoma, Sans-Serif;
color:#564b47;
padding:0px;
margin:0px;
}

#top {
background-image: url('../img/top.png');
background-repeat: repeat-x;
width: 100%;
height: 96px;
}

#rightSide{
overflow: hidden;
}

#sidebar{
position: relative; 
background:lightblue;
border-right:1.7px solid #FFFFFF; 
min-height: 100%;
line-height: 100%;
float: left; 
height:  100%;
margin-top: -5px;
}

#sidebar ul li {
list-style-type: square;
list-style-position: inside;
width:209px;
height:100%;
margin-top:15px;    
}
#sidebar ul li a{
list-style-position: inside;
display: block;
color:#3C3C3C;
text-decoration:none;
font-size:13px;
font-weight:bold;
padding:10px 20px 10px 40px;

}
#sidebar ul li a:hover {
color:#7da536;
width:209px;
border-right: 1.7px solid #ECEDEF;
background: #ECEDEF;
}
#sidebar ul li a:active{
background: #ECEDEF;
border-top: 1.7px solid #D8D9DB;
border-bottom: 1.7px solid #FFF;
border-right: 1.7px solid #FFF;
width:149px;

}

#content{
margin-left: 10px;

}

#bottom {
position: absolute;
bottom: 0;
background-color: #ECEDEF;
width: 100%;
padding: 53px 0 0 0;
}

#bottom1 {
position: absolute;
bottom: 0;
/*background-color: #ECEDEF;*/
background-color: greenyellow;
/*    width: 85.3%;*/
width: 100%;
padding: 53px 0 0 0;

/*    margin-left: 211px;*/
}
  • This should get you closer. Set the container to absolute and the child divs to relative: http://jsfiddle.net/mYw72/1/ – Matt Mar 04 '13 at 19:04

2 Answers2

5
html, body, #container { height: 100% }
Eric Goncalves
  • 5,253
  • 4
  • 35
  • 59
  • no problem. in order to set the height of an element to 100% you need to make sure that its parents all have height 100% or a set height. including html and body. – Eric Goncalves Mar 04 '13 at 19:11
1

You can set the height of your left bar to 100% after all things it is inside are also set to the height of 100%.

example css:

html, body, #container{height:100%}
#sidebar{height:100%;}
Tom
  • 314
  • 2
  • 14