Note: Eric A. Meyer was so kind to let me know that the hack below results in a blank grey screen in IE5/Mac. I'm currently playing with selector bugs but it will take a few days until I can check it on a Mac myself. | 19:08 2/6/02

position: fixed; fixed

Unlike other modern browsers like Opera 6 and Netscape 6/Mozilla, Internet Explorer 6 still doesn't honor fixed positioning with CSS.

Fixing the wrong problem

The mature solution would be not to use problematic visual effects at all.

Of course two possibilities to fix an element in the canvas have been around a long time before CSS became popular.

Since Frames And Client Side Scripting Are Evil(TM), consider a pure CSS hack which should at least 'work' in Internet Explorer 6, Opera 6 and Netscape 6.*/Mozilla 0.9.* for windows.

Here's the relevant fix:

The comments should hide the declarations from IE5/Mac

html/*nonsense*/
   {
   overflow: hidden;
   }

body
   {
   margin: 0;
   padding: 0 8px;
   }

body/*nonsense*/
   {
   height: 100%;
   overflow: auto;
   }

div#fixed/*nonsense*/
   {
   position: absolute;
   top: x;
   left: y;
   }

And here's to the good ones:

Internet Explorer doesn't understand the child selector, Opera 6 and Netscape 6/Mozilla 0.9.* don't suffer from the IE5/Mac selector/comment bug. *whew*

html>body
   {
   height: inherit;
   overflow: visible;
   }

body>div#fixed
   {
   position: fixed;
   top: x;
   left: y;
   }
Rant In A Box | acid.base
Copyfight © February 06, 2002 Eric B. Bednarz | thebox@deds.nl