I’m having trouble getting the elements in my <div id="wrapper"> to push down my footer. At the moment the wrapper flows into the footer. How can I fix that?
Here is my HTML:
<div id="header">
</div>
<div id="wrapper">
<div id="findcontent">
<div id="criteriabar">
</div>
<div id="searchresults">
</div>
</div>
</div>
<div id="footer">
</div>
With the following CSS:
#header {
position: relative;
display: block;
height:65px;
}
#wrapper {
right: 0;
left: 0;
position: relative;
padding: 0;
}
#findcontent {
position: relative;
min-width: 960px;
min-height: 400px;
margin: 0 20px;
}
#criteriabar {
position: relative;
float: left;
width: 190px;
border-right: 1px solid #CCC;
height: 100%;
padding-right: 20px;
left: 30px;
top: 30px;
}
#searchresults {
position: relative;
width: 770px;
left: 40px;
right: 10px;
top: 30px;
}
#footer {
display: block;
zoom: 1;
position: relative;
overflow: hidden;
border-top: solid 1px #CCD9FF;
margin: 20px 0px 10px;
}
UPDATE: Adding class="clearfix" alone didn’t do it. I had to also change top to margin-top for floating elements inside of <div id="find content">.
You have floated divs inside your wrapper which need to be cleared. You have two options:
Option 1:
Option 2:
// CSS
// HTML