div’s to fill the whole screen

Published by Rob on October 29th, 2004 - in Java

When working with a combination of divs, and tables, I have ended up beating my head against getting a div to go all the way to the end of where the page scrolls to. This is useful to make the familiar navigator bar on the left side go all the way to the end of the page.

The way to do it is to make sure that the html and body tags actually go to the bottom. The thought being that something will only go to the end if it’s container goes to the end. (In some bizarre land I am sure this makes sense).

To do this, simply put this into the stylesheet:
html,body {
height: 100%;
}

Information courtesy of google and Web Master world

Related posts:

  1. Adding a swing component to a Form Test Driven
  2. Dynamic display with JGoodies

One Response

  1. jon says:

    Thank God for this tip. What a star!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Rob@Rojotek