The following, in Firefox 3.6, simulates a modal overlay:
<html>
<body>
<div id="modal" style="position: fixed;
top: 0; left: 0;right: 0; bottom: 0;
background: rgba(255,0,0,0.5);
z-index: 10;">
<div style="border-style:solid;border-width:5px;
position: fixed;top: 50%;left:50%">
<h2>I am modal</h2>
<form><input type=submit></form>
</div>
</div>
<div id="notModal" style="height:500px;
border-style:solid;border-width:5px;">
<div>
<h2>a I am not modal</h2>
<p>lorem ipsit dolar foo bar baz</p>
<form><input type=submit></form>
</div>
</div>
</body>
</html>
In particular, text in the “modal” div can be selected, and the submit button in the “modal” div can be clicked, but nothing in the “notModal” div can be selected or clicked.
In Internet Explorer 8, that’s not the case; the “notModal” text can be selected and teh “notModal” submit can be cliecked.
Is there a way to make this work under the various versions of IE, without using javascript?
Thanks.
IE has a lot of issues with transparency (it doesn’t support
rgba). There are also known issues with z-indexing.Try something like this.
Notes:
cover(previouslymodal) div so that IE doesn’t try to apply the filter to it.Example
HTML
CSS