KHTML’s irritating positioning bug

I’ve run into this damn bug every time I’ve tried to implement drop-down menus in CSS. I think dropdowns are a stupid idea in the first place, but clients will be clients.

The problem is that in some cases, KHTML doesn’t consider an inline position: relative element to be a positioned ancestor, and absolutely-positioned children aren’t positioned relative to it. The weird thing is that I can’t reproduce the problem with two nested divs. I wonder what’s special about lists and items that makes it break?

The upshot is that instead of a dropdown menu appearing where it should, it’s way over on the other side of the screen, where you can’t get to it before it disappears. It’s terribly frustrating, and makes the dropdown experience that much worse for Safari/Konqueror users.

2005/07/19
Previously On Atomized:

Participate