I have the following problem: I need to let a div have the height of the screen time.
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="topo">...</div>
</div>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12" id="menulateral"> ...</div>
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12" id="principal"> ... </div>
</div>
I just want to do what the div with the identifier menulateral
has all the time the height of the screen.
I was trying to do it this way:
var altura = $("body").height();
$("#menulateral").height(altura);
I do not know if this is the best way for me to do it, because I would like it to work without problems and on all the devices that could access this page. Is there a better, more reliable solution?