Link to home
Start Free TrialLog in
Avatar of LBGUC04
LBGUC04

asked on

CSS positioning horizontal blocks IE6

i want to split my spreadsheet into three horizontal blocks top, middle and bottom. I want the top to take up 15% of the screen, the middle 80% and the bottom 5%. I also want them to keep these % as the browser window is resized. Ive tried looking at relative , floating etc but havnt been able to work this one out
Avatar of CCSOFlag
CCSOFlag
Flag of United States of America image

you will need to use absolute positioning along with percentage heights:

      <div id="Top" style="height: 15%; background-color: #000; position: absolute; top: 0; width: 100%;">
    </div>
      <div id="Middle" style="height: 80%; background-color: #666; position: absolute; top: 15%; width: 100%;">
    </div>
      <div id="Bottom" style="height: 5%; background-color:#CCC; position: absolute; top: 95%; width: 100%;">
    </div>
although I can't test it in IE6, but it SHOULD work in IE6.  
Avatar of LBGUC04
LBGUC04

ASKER

the bars are in the right place but there is no height to them so they dont appear as full color blocks
even with the height style set to their corresponding percentages?
Avatar of LBGUC04

ASKER

even with the % ive also just tried adding display: block bu this hasnt sorted it either
ok well IE6 was retarded when it came to divs.  Try converting it to a table like this:

      <table>
      <tr id="Top" style="height: 15%; background-color: #000; position: absolute; top: 0; width: 100%;">
          <td>
            text on top
        </td>
    </tr>
      <tr id="Middle" style="height: 80%; background-color: #666; position: absolute; top: 15%; width: 100%;">
          <td>
          text in middle
        </td>
    </tr>
      <tr id="Bottom" style="height: 5%; background-color:#CCC; position: absolute; top: 95%; width: 100%;">
          <td>
          text on bottom
        </td>
    </tr>
         </table>
Avatar of LBGUC04

ASKER

The height of the color is only 1 row in thickness is there anyway to get it to fill the whole % of each horizontal line?
Avatar of LBGUC04

ASKER

ive also noticed that when resizing the screen it doesnt keep auto adjust the % very well. its anoying as i had this working in IE7 but i need to have it working on IE6
try adding min-height: 15%/80%/5% to the corresponding sections.  I feel your pain.  I spent countless hours trying to get stuff to work in IE6, until I was finally able to convince my organization to upgrade to IE7.  :)  
Avatar of LBGUC04

ASKER

Ive tried many different approaches to this now, does anyone else have any ideas on how to get this to work?
ASKER CERTIFIED SOLUTION
Avatar of SSupreme
SSupreme
Flag of Belarus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LBGUC04

ASKER

Many thanks