[Javascript] doubt about page height

David Hucklesby davidh126 at writeme.com
Sat Mar 15 16:04:06 CDT 2008


On Fri, 14 Mar 2008 06:54:44 -0400, Roger Roelofs wrote:
> Welcome!
> On Mar 14, 2008, at 3:46 AM, Tamilarasi Elumalai wrote:
>>
>>
>> am using div control to place all my web page content and set its width as 80% and
>> center align. but i couldnot set page height for all size of browser. 
>>
>
> This is more likely a css question, and you will get more complete answers on the CSS-D
> mailing list at http://css-discuss.org/.    The short answer is that you must set
> height: 100%; on html, body and any other element that contains the div you are trying
> to position.    
>
>
> In most cases I recommend against setting the height because it puts the scroll bar on
> your content rather than on the window where users expect it.
>

Roger is correct if you use "height" on the content DIV, except for 
IE 5.x and 6, which tend to treat "height" similar to "min-height".

Solution: Use 100% on html and body as suggested, then add:

  #wrapper {min-height: 100%;}  /* for modern browsers */
  * html #wrapper {height: 100%;} /* for IE 5 and 6 Win */

(Assuming your centered DIV has an ID of "wrapper".)

Cordially,
David
--




More information about the Javascript mailing list