0

I am giving body height 100% by using this code:-

  <div class="container" id="container" style="background-color:#FAFAFA;">
  <div class=" span5 fill">

  </div>
</div>

And css is:-

  .fill{
  height:100%;
  min-height:100%;
  }


  .container{
  height:100%;
  min-height:100%;
  }

But when i am adding dynamic content in 'fill' div, then content not in 100% body tag.

neooo
  • 241
  • 1
  • 4
  • 11

1 Answers1

0

I noticed you tagged jQuery so here is a simple function that you can use to set the height dynamically. It also changes based on the browser resizing.

Fiddle: http://jsfiddle.net/xfnyzcos/

jQuery Code:

function setHeight(){
    var winHeight = $(window).innerHeight();
    $(".container").css("height", winHeight + "px");
    $(".fill").css("height", winHeight + "px");
}

$( window ).resize(function() {
    setHeight();
});

setHeight();
amazedinc
  • 418
  • 3
  • 16