HarryS: layer will über iframe

Beitrag lesen

Hallo Michael's

nö, geht nicht.

gruß
mhuhn

Das würde ich SO nicht sagen. Probier mal folgendes:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>IFrame mit Ebenen</title>

<style type="text/css">
#ebene1 {position:absolute; left:100px; top: 90px; z-index:1; background-color:blue; color:white; width:200px; height:100px; }
#ebene2 {position:absolute; left:160px; top:110px; z-index:2; background-color:lime; color:black; width:200px; height:100px; }
iframe  {position:absolute; left:  0px; top:130px; z-index:3; background-color:red;}
#anzeige{position:absolute; left:  0px; top:130px; z-index:3}/*nur für den text im IFRAME*/
#ebene4 {position:absolute; left:240px; top:160px; z-index:4; background-color:yellow; color:black; width:200px; height:100px; }

</style>
</head>

<body>
<p>Folgendes Beispiel zeigt, wie man einen IFRAME mittels position und z-index wie eine Ebene (bzw.Layer)
Positionieren kann. <br>Ohne position:absolute oder relative bleibt der z-index (außer in MOZ natürlich) ohne Wirkung.
Background Angaben zeigen ebenfalls nur in MOZILLA eine Wirkung.
<br>Erfolgreich getested mit MOZILLA1.1 OPERA5.12 und 6.04 sowie IE6. CSS und HTML sind valide. NS4 scheidet natürlich aus, weil er IFRAME nicht kennt.</p>

<iframe name="Bildframe" width="300" height="200" align="left" scrolling="yes" marginheight="0" marginwidth="0" frameborder="1">
</iframe>

<div id="ebene1">z-index:1</div>
<div id="ebene2">z-index:2</div>
<div id="ebene4">z-index:4</div>
<div id="anzeige">Der z-index des IFRAME ist auf 3 gesetzt</div>
</body>
</html>

Erklärungen stehen im Quältext

Grüße aus Nürnberg, HarryS