Alternate Box Model Hacks

I was struggling with a peculiar CSS bug in IE 5.0 on Windows when using absolute positioning inside a div with position: relative;. Regardless of what I did, the absolutely positioned div would sit flush to the left, rather than inheriting the border of the enclosing div.

Using Tantek’s Box Model Hack appeared to work by giving the left: 8px; I needed to IE5, and overriding this with left: 0; for everyone else. The problem is that the rule works for all IE5/Win browsers — not just IE5.0 which I was having the problem with exclusively.

Enter this page of Alternate Box Model Hacks — of which methods are described for hiding CSS rules specifically for IE5.0 or IE5.5. I ended up using part of Technique 1 like this:

left: 8px; /* for IE5.0/Win */
left/* */: 0; /* for everything else */

I believe hope the problem is solved.