I want to change the body height dynamically using css expression.. my code is
HTML
<body >
<div class="tall_top" >
</div>
</body>
CSS
body {
width: 100px;
height: expression(document.documentElement.clientHeight);
background: red;
}
.tall_top {
background:#f1f1f1;
width:50%;
height:50%
}
But It is not working in google chrome….. The inner div is not displaying. The height of body displaying in inspect element is 0px;
JS Fiddle
div.tall_topdoes not show up because yourbody,htmldoes not have a height.Set the height to
100%Demo: http://jsfiddle.net/codef0rmer/3x6fh/2/