开发者

Need a css or jquery solution to expand a nested div to 100% [duplicate]

This question already has an answer here: 开发者_高级运维 Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜