?
Solved

CSS positioning horizontal blocks IE6

Posted on 2011-02-14
14
Medium Priority
?
229 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
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.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

770 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