I have a grid of nine "widgets". Each widget has a .widget-header
, .widget-body
, and .widget-footer
.
The heights of the .widget-header
and .widget-footer
will vary, and I'd like the .widget-body
. to just take up whatever space is left. The content inside the .widget-body
will scale.
Here's my fiddle: (you'll need to stretch the width of the "result" area so you can see the 3x3 grid).
One of my widgets:
<div class="widget widget-chart">
<div class="widget-header">
<h5>Socioeconomic: Middle Class and Performance: High</h5>
</div>
<div class="widget-body">
<img src="http://www.mathgoodies.com/lessons/graphs/images/line_example1.jpg" />
</div>
<div class="widget-footer">
<p>This is some footer content.</p>
</div>
</div>
And the related CSS:
.widget{
height: 100%;
width: 100%;
}
.widget .widget-body{
width: 100%;
height: auto;
}
I'm pretty sure height: auto;
isn't doing anything because it probably already is auto. Any ideas?