Reputation: 3767
It does it for every other browser ( I think ).
http://www.webdevout.net/test?01H&raw
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Test</title>
<style type="text/css">
* { overflow: visible; }
#precedence { float: right; height: 60px; width: 50px; background: pink; margin-bottom: -10px; margin-right: 20px; overflow: visible; }
#first { height: 50px; border: 1px dashed blue; background: white; margin-bottom: -10px; z-index: 100; position: relative; overflow: visible; }
#second { height: 50px; border: 1px dashed red; background: white; z-index: -1; overflow: visible; }
</style>
</head>
<body>
<div id="first">
<div id="precedence"></div>
</div>
<div id="second"></div>
</body>
</html>
Upvotes: 0
Views: 85
Reputation: 18076
Add position: relative;
to the box (#precedence
). This will force IE to put it in the layering calculations it does. It will then realize that it is not contained inside it's parent (#first
) and will overflow properly.
This is the tested example: http://jsfiddle.net/s4W52/
It works in IE6, IE7, IE8, Firefox 2.0.x/3.0.x, so it should work in others too
Upvotes: 1