uzay95 uzay95 - 5 months ago 9
CSS Question

How can I stretch a div to 100% page height?

<html>
<head>
<style>
.100PercentHeight{ }
</style>

</style>

<body>
<div class='100PercentHeight'>hihi</div>
</body>
</html>


How can I stretch div to 100% height of page?

Answer

Try (it should work in most browsers):

.100PercentHeight, html, body {
    height : auto !important; /* Ignored by Internet Explorer, applied everywhere else. */
    height : 100%;            /* Internet Explorer treats as min-height. */
    min-height : 100%;        /* Internet Explorer ignores this. */
}
Comments