Quote:
Originally Posted by barnettgs
It's a problem when there is few texts. Any solution to this?
Also is it possible to make DIV box filling browser windows 100% height?
Thanks in advance
|
Would have to see the code to even begin to understand what your first question means.
However, your second question is easy enough to to.
In your CSS, add min-height: 100% to the div in question.
Now the div still won't be 100% high, because it needs an antecendent element with a declared height - to be 100% of...
So, to achieve 100% height in the browser viewport, you'll need to make both the html and body elements 100% high also:
Code:
html, body {
height: 100%;
}
Then you'll need to tell the div in question to have a minimum height of 100%...
Code:
div#mydiv {
min-height: 100%;
}
But there's stil a problem: IE versions 5- 6 don't understand min-height and will ignore it. However IE 5 - 6 treaght the 'height' property as it were min-height.
so the next step would be to feed IE 5 -6 soem specific rules that none of the other browsers out there will read, best way is to use conditional comments, like so:
Make a css document called, let's say: iehacks...
and add this rule to it:
Code:
div#mydiv {
min-height: 100%;
}
Then link to the iehacks.css file by placing the following code (known as a conditional comment) in the < head > of your html document.
Code:
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="css/iehacks.css" />
<![endif]-->
Hope that helps? I think I got it right, as I've been working on a 100% height web layout today
If I got anything wrong, it's
because I've been working on a 100% height layout all day
Kind regards, and good luck,
Gary