Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE6 full screen div

Basically, I have to present a full-screen div on my page for various reasons. Now this is relatively straightforward in non-IE browsers (absolute positioning, top/left/right/bottom at 0px) and can be easily done on IE7 too (with some tweaking) however I just can't get it working on IE6.

What's weird that I can get it working in quirks mode but when I turn on standards compliance mode, the div does not fill horizontally the screen. Unfortunately, I need standards compliance mode for other elements on the page.

Here's my CSS:

div#myId
{
    background-color: #3070cf;
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 100%; /* Removing width or height doesn't help either */
    height: 100%;
}

My demo page is basically a standards-compliant XHTML with the appropriate DOCTYPE having only this single div (id="myId") in its body.

Now I know that absolute positioning is generally not a good idea, but as I said, I really need it in this case. Anyone any suggestions?

like image 217
Tamas Czinege Avatar asked Dec 03 '22 08:12

Tamas Czinege


1 Answers

Have you tried setting this as well?

html, body{
  height: 100%;
  width: 100%;
}
like image 147
Seb Avatar answered Dec 16 '22 10:12

Seb