I try my best to make the div expand fully to the height of the container.
Markup:
<div class="container"> <div class="innerOne inner"></div> <div class="innerTwo inner"></div> </div>
In different .innerTwo content is higher than .innerOne , but I would like the background to be the same size as .innerTwo
Styles:
.container { width: 100%; height: auto; background-color: yellow; /* clearfix */ *zoom: 1; &:before, &:after { display: table; content: ""; line-height: 0; } &:after { clear: both; } } .inner { float: left; width: 50%; height: 100%; background-color: red; }
But the heights do not match. I know that this can be done by providing the container with a given height, but I do not want to do this, because it is a responsive site. Is it possible? I would prefer not to use JS.
Adam waite
source share