Hello there I am currently just making a sample website to try and get back into the swing of things but I am encountering a problem with one of my divs. The div giving trouble is the leftContent div. I want to set the height of it to fit the screen down to the footer but when I set it to 100% it over flows the footer causeing you to scroll down. As there is currently no content inside it I dont want this. Please find below my code. Any help on this matter would be greatly appreciated.
Html code
<html> <head> <link rel="stylesheet" href="css/main.css"/> <title>Ep is a ledge!</title> </head> <body> <div id="container"> <div id="header"> <div id="logo"> <img src="images/logo.png" alt="Logo" style="border:0;" > </div>
This is the header div
</div><!--end of header div--> <div id="navbar"> <ul> <li><a href="#">Home</a> <li><a href="#">About</a> <li><a href="#">Services</a> <li><a href="#">Photos</a> <span id="rightBorder"><li><a href="#">Contact</a></span> </ul> </div><!--end of navbar div--> <div id="leftContent"> <p>This is left contentThis is left contentThis is left contentThis is left contentThis is left contentThis is left contentThis is left content</p> </div><!--end of leftContent div--> <div id="rightContent">
This is right content
</div><!--end of rightContent div--> <div id="footer">
This is the footer
</div><!--end of footer div--> <div style="clear:both;"></div> </div><!--end of container div--> </body> </html>
Css code
*{
padding:0;
margin:0;
}
#container{
border-left:1px solid #000;
border-right:1px solid #000;
width:80%;
height:100%;
min-width:900px;
margin: 0 auto 0 auto;
}
#header{
border-top:1px solid #000;
border-bottom:1px solid #000;
height:152px;
width:100%;
float:left;
line-height:150px;
background: #0078ff;
font-size: 50px;
font-family: "aerial", Georgia, Serif;
font-weight: bold;
font-style: italic;
}
#logo{
width:150px;
float:left;
padding-right:50px;
padding-left:10px;
padding-top:1px;
}
#navbar{
float:left;
width:100%;
height:30px;
line-height:30px;
border-bottom:1px solid #000;
text-align:center;
}
#navbar ul{
list-style-type: none;
}
#navbar li{
display:inline;
padding-right:10px;
padding-left:10px;
border-left:1px solid #000;
}
#navbar ul li a{
text-decoration:none;
color:#000;
}
#navbar ul li a:hover{
font-weight: bold;
font-style:italic;
color:#c1bdbd;
}
#rightBorder{
border-right: 1px solid #000;
}
#leftContent{
float:left;
width:20%;
height:65%;
border-right:1px solid #000;
}
#footer{
position:fixed;
bottom:0;
border-top: 1px solid red;
width:80%;
height:50px;
margin: 0 auto 0 auto;
line-height:50px;
text-align:center;
}