Solved

CSS positioning horizontal blocks IE6

Posted on 2011-02-14
14
221 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:LBGUC04
  • 6
  • 5
14 Comments
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 34888852
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>
0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 34888863
although I can't test it in IE6, but it SHOULD work in IE6.  
0
 

Author Comment

by:LBGUC04
ID: 34888998
the bars are in the right place but there is no height to them so they dont appear as full color blocks
0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 34889021
even with the height style set to their corresponding percentages?
0
 

Author Comment

by:LBGUC04
ID: 34889059
even with the % ive also just tried adding display: block bu this hasnt sorted it either
0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 34889297
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>
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:LBGUC04
ID: 34894745
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?
0
 

Author Comment

by:LBGUC04
ID: 34894803
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
0
 
LVL 9

Expert Comment

by:CCSOFlag
ID: 34896979
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.  :)  
0
 

Author Comment

by:LBGUC04
ID: 34915000
Ive tried many different approaches to this now, does anyone else have any ideas on how to get this to work?
0
 
LVL 16

Accepted Solution

by:
SSupreme earned 500 total points
ID: 35081908
Try this out:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<style type="text/css">
* {	margin: 0px; padding: 0px;}  
html, body {height:100%; width:100%}
#page {width:70%; height:100%; margin: 0 auto;}
#top {width:100%; height:15%; background:green;}
#middle {width:100%; height:80%; background:orange;}
#bottom {width:100%; height:5%; background:pink;}
</style>

</head>
<html>
<body>
 <div id="page" >
 <div id="top" >
 
 </div>
 <div id="middle" >
 
 </div>
 <div id="bottom" >
 
 </div>
 </div>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:LBGUC04
ID: 35206104
Many thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now