Question

Currently I have a web page with a background image size of cover. I would like 2 divs inside of this div with 100% height. These divs need to be responsive. I need the leftside div to have an image to sit on the bottom. I am using clearfix on the main containers but the class pic still goes up to container 1.

HTML

<div class="main-container1 clearfix">
</div>

<div class="main-container2 clearfix">
 <div class="wrapper">
  <div class="leftside"><img class="pic" src="image/blank.png" /></div>
  <div class="rightside"></div>
 </div>
</div>

CSS

body {
height:100%;
overflow:scroll;
}

.main-container1 {
background-image:url(../images/footballfieldblur.jpg);
background-position:center center;
background-repeat:no-repeat;
background-size:cover;
min-height:100%;

}
.main-container2 {
background-image:url(../images/footballfieldblur.jpg);
background-position:center center;
background-repeat:no-repeat;
background-size:cover;
min-height:100%;

}

.wrapper {
width:90%;
margin:0 auto;
height:100%;
min-height:100%;
}

.leftside {
width:40%;
height:100%;
min-height:100%;
float:left;
position:relative;
}

.rightside {
width:60%;
height:100%;
min-height:100%;
float:right;
position:relative;
}

.pic {
position:absolute;
bottom:0;
}

.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}

.clearfix:after {
clear: both;
}

.clearfix {
*zoom: 1;
}
Was it helpful?

Solution

Alright guys I figured it out. My divs were not expanding 100% height of my clearfix containers because the clearfix class was not 100% height.

.clearfix {
*zoom: 1;
height:100%;
min-height:100%;
} 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top