I want to create a responsive/fluid grid which has 2 rows of content .tier1
and .tier2
. The contents should always fit inside the dimensions of the viewport with .tier1
occupying 60% of the height and .tier2
the remaining 40%. At the moment I'm not sure what the best approach to this is, using javascript I could keep an eye on the viewport dimensions and set a height so that the .tier
containers applied % heights take effect but I was wondering if I can just do this using CSS?
CSS
.content1 {
height: 60%;
}
.content2 {
height: 40%;
}
HTML
<div class="container">
<div class="tier">
<div class="content content1">
<img src="http://dummyimage.com/600x400/000/fff">
</div>
</div>
<div class="tier">
<div class="content content2">
<img src="http://dummyimage.com/600x400/dedede/fff">
</div>
</div>
</div>
Fiddle http://jsfiddle.net/EK6QT/1/