<html>
<head>
<style>
.100PercentHeight{ }
</style>
</style>
<body>
<div class='100PercentHeight'>hihi</div>
</body>
</html>
How can I stretch div to 100% height of page?
<html>
<head>
<style>
.100PercentHeight{ }
</style>
</style>
<body>
<div class='100PercentHeight'>hihi</div>
</body>
</html>
How can I stretch div to 100% height of page?
If you want to do it via JavaScript this code should work for most DOM browsers...
This will not work if you have a DOCTYPE. I'm looking for an answer too, but I have a DOCTYPE. However, there is a way to do it with a DOCTYPE, but it doesn't work with two divs floating left and right next to eachother, try:
Be aware that this doesn't look good at all when using two divs floating next to eachother. But, it works fine for any other type.
This will work, as an example.
Try (it should work in most browsers):
Use:
This way, it will be centered and cover the page if it is longer than one browser view long.
You should set 100% height for the body and it should do: