IE6 (of course) Vs. DIV Height 100%

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EmersonUK
    New Member
    • Jul 2009
    • 2

    IE6 (of course) Vs. DIV Height 100%

    I’ve worked around a couple of times with DIVs using height:100% and I had no problems at all, testing on many browsers (IE7, FF3, FF2, Opera, Safari and Chrome).
    Now I’ve tried the same idea on a new website and I can’t see what’s going wrong on IE6. The DIV never covers the entire page.

    Any ideas? Thanks for your help,

    Emerson

    The entire code:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    
            <style type="text/css">
                body {background-color:#999999;}
                
                html, body {margin:0; padding:0; height:100%;}
                
                .outerContainer {width:100%; min-height:100%; position:absolute; display:block;}
    
                /* IE6 Hack */
     
                * html .outerContainer {height:100%;}
    
                .mainDiv {width:1000px; margin:0 auto 0 auto; display:block; background-color:#C0C0C0;}
    
                .lockerContainer {width:100%; height:100%; position:absolute; top:0px; left:0px; background-color:transparent; background-color:#000000; opacity:.6; filter:alpha(opacity=60); z-index:20;}
            </style>
        </head>
        <body>
            <div class="outerContainer">
                <div class="mainDiv">
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
                </div>
                <div class="lockerContainer"></div>
            </div>
        </body>
    </html>
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    I don't have IE6 available right now to look but 'min-height' has never worked in IE6 while 'height' is treated as min-height.

    Comment

    • EmersonUK
      New Member
      • Jul 2009
      • 2

      #3
      Originally posted by drhowarddrfine
      I don't have IE6 available right now to look but 'min-height' has never worked in IE6 while 'height' is treated as min-height.
      Yes, I know that. That's why I'm using the star hack:

      Code:
      /* IE6 Hack */
        
      * html .outerContainer {height:100%;}
      Thanks anyway.

      Comment

      Working...