Floating div disappears when background-color added to parent div in IE7
Strangely, this happens with IE7 and not IE6.
Set Up:
Inside of the mother div is a floating div (with graphics and a Flash audio player—but the content is unimportant since I’ve tried it without the Flash). The child floating div has a border all the way around.
Problem:
When I add a background-color to the mother div, the child below the top border disappears. It’s still “visible” to the cursor (hovers still work), but no visual.
Solution:
Add position: relative on the child element. Happiness ensues.
From now on, any IE6 and IE7 visual glitches will be attacked with position: relative and zoom: 1. It seems that either one or the other works in 80% of cases.
Strangely, this happens with IE7 and not IE6.
Set Up:
Inside of the mother div is a floating div (with graphics and a Flash audio player—but the content is unimportant since I’ve tried it without the Flash). The child floating div has a border all the way around.
Problem:
When I add a background-color to the mother div, the child below the top border disappears. It’s still “visible” to the cursor (hovers still work), but no visual.
Solution:
Add position: relative on the child element. Happiness ensues.
From now on, any IE6 and IE7 visual glitches will be attacked with position: relative and zoom: 1. It seems that either one or the other works in 80% of cases.
Labels: float bug, IE7, position: relative fix
1 Comments:
Thank you! you helped me out. I love me some position: relative when it comes to IE!
:)
Post a Comment
<< Home