We help IT Professionals succeed at work.
Get Started

How to set div / footer properties so div doesn't extend below footer

louise001 asked
Last Modified: 2008-02-01
I have a div #Main with the property height: 100%. Inside this I place a table #MainTable also with height: 100% . My CSS is below the end of this message. This is in a three column with header and footer layout. I want the div #Main always to occupy 100% of the space between the header and footer but it's extending below the footer. I can alter the height of the div so that it fits on one particular screen, but obviously that's too restrictive. If I don't set the height property at all, it's way short of the footer.
Grateful for any help.

      position: absolute;
      width: 90%;
      height: 100%;
      margin-left: 5%;
      margin-bottom: 2px;
      background-color: #FFFFFF;

/* Main table */
/*Note on margins in tables in CSS2: in CSS2 table cells, rows and columns have no margins, only padding*/

      padding-top: -1em;
      vertical-align: top;
      width: 100%; /* the table's width property is percentage of its containing div*/
      height: 100%; /* the table's width property is percentage of its containing div*/

      position: absolute;
      bottom: 0;
      width: 90%;
      margin-left: 5%;
      /*left: 20%;*/ /*this property has no effect in Mozilla or IE - nothing at all happens*/
      padding: 7px 0px 7px 0px;
      background: url(http://uklondb1/frontier/images/bg_footer.gif);
Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE