Problem with background: transparent in IE (7, at least)
What happens:
- The background of the "menu" (two blocks) is red.
- The background of the link is blue.
- When a:hover is background:red (or any solid color), there is no problem:
- But when a:hover is background:transparent, in IE7 the link block flickers as you mouse over it, and the cursor flickers between "hand" and "arrow":
- And what about when the hover background is an image?
oddly enough, not only does it work, but the transparent areas of the .gif show the underlying red background just fine.
- So maybe our old friend spacer.gif can do the job:
And what do you know, it does.
- More tests: no special hover state, link is background:transparent
Result: cursor flickers on and off as you move it around.
- Linkless block with transparent background, on top of red:
- Top block has border, transparent background:
- Alan Gresley found that if the links are floated, there is no flicker:
- If they are not given any special position state (not absolute, not floated), don't have the "menu" class:
so it seems to be a combination of position:absolute plus background:transparent.
- Alan Gresley said this is the dread hasLayout property at work. He suggested that giving li "layout" via width:100% or float:left; would fix the problem.
Float works (#10 above), width -- as you can see -- doesn't, whether I use width:100% or width:150px.
- For added wacky fun, look what happens when I give li both width and height:
No flicker for "first", flicker for "second". *gnash gnash* Oh hey, maybe bother are flickering after all.
- Can we gain "layout" via zoom=1?
No.