Solved

CSS positioning horizontal blocks IE6

Posted on 2011-02-14
14
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 
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
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

689 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