The IE7 demo page has been updated. Follow along if you’d like.
I’ve run into my old friend, the background color bug. But now I understand it.
If you try to use menu #5 to navigate
layouts->skidoo->background images you’ll find the menu disappears as you move between
background images and
border into masthead. (Actually it might vary depending on your computer’s default font size).
In Menu #6 it works fine. What’s wrong with #5? Well the only difference between 5 and 6 is that 6 has a background-color set on the UL elements.
It seems what’s happening is as the mouse moves between elements in the popped menu IE is calculating what object it’s currently on top of. Without a background color, the text of the page (perhaps any element outside of the menu system) appears to take the focus, as if it’s on top of the menu. It’s like IE is looking THROUGH the menu item.
If I add a background color to the anchors or ULs IE will recognize there’s an object between the mouse and the text and that will get focus and the menu doesn’t disappear.
Now I’ve got a background color set on the LI elements. I set a background color on the anchors only when they have focus. This is so I can use color to show the path to the current position in the menu. (Note how the Layouts and Skidoo menu options turn orange as you get to the third-level of the menu.) If I did set background colors on all anchors, even those that aren’t active, this disappearing menu (background color) bug goes away.
So backgrounds on ULs and anchors fixes it, but not the LI. Why?
Well, the UL and anchor tags have hasLayout triggered. The LIs don’t.
So we see yet one more curious property of hasLayout.
And here’s the thing. Here’s a really big gripe with IE7. They’ve had several years to develop a new rendering engine. Did they? No. They just patched what they could of the old engine. So this reliance on the infamous hasLayout property will continue, along with all the bugs associated with it. And as long as they continue to use their old layout engine IE will continue to suck for advanced CSS design.
Microsoft: REWRITE IE’S LAYOUT ENGINE!
Oh, haven’t heard back from those IE guys yet, but I did forward along the information I had on this bug.
Is everyone else starting to understand why I hate IE7?