Need a css or jquery solution to expand a nested div to 100% [duplicate]
Possible Duplicate:
nested relative positioned div needs to have a 100% height
I haven't figured out what needs to be done to get this http://osf.fivetoolsoftware.com white nested div to expand to 100% height of the container size. I have tried css variations for a few hours and have nothing to show for it.
Original question: nested relative positioned div needs to have a 100% height
Anyone know of a solution?
This should do it in your javascript file or in a javascript block (make sure you've included jquery above this code)
var h = window.innerHeight;
$('div#canvas').css({'height':h+'px'});
I'm not sure, but you could try this:
<style>
.expand{
width: 100%;
display: block;
}
.block{
display:block;
}
</style>
And your html would be:
<div class="block" ...> <!-- Parent div -->
<div class="expand" ...> Your div </div>
</div>
Hope this helps. Cheers
精彩评论