Div fixe et à l'intérieur des éléments iframe
Question
J'ai un problème avec le code HTML. J'ai essayé beaucoup de solutions mais je n'ai pas résolu mon problème. Excatly mon problème est; si j'ai utilisé deux div à l'intérieur de la page html et que les deux divs doivent contenir des éléments iframe, je n'ai jamais vu la page html correcte dans le navigateur.
Remarque: chaque div doit avoir l'attribut position: fixed css.
Exemple de code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<style>
body{margin:0px;}
.modalWrapper
{
position:fixed;
display:block;
width:500px;
height:300px;
background-color:#000;
color:#fff;
margin:0px;
top:50px;
left:500px;
z-index:100;
}
.modalHeader{ width:100%; height:80px; }
.modalNavigator { background-color:#ccc; height:220px; }
.bottomWrapper
{
position:fixed;
display:block;
width:100%;
height:300px;
background-color:#000;
color:#fff;
margin:0px;
bottom:0px;
z-index:99;
}
.bottomHeader{ width:100%; height:80px; }
.bottomNavigator{ background-color:#ccc; height:220px; }
</style>
</head>
<body>
<div>
<div class="modalWrapper">
<div class="modalHeader">
Modal
</div>
<div class="modalNavigator">
<iframe frameborder="0" src="http://www.yahoo.com" id="Iframe1"
style="height: 220px; width: 100%;" scrolling="no"/>
</div>
</div>
<div class="bottomWrapper">
<div class="bottomHeader">
Bottom
</div>
<div class="bottomNavigator">
<iframe frameborder="0" src="http://www.google.com.tr" id="Iframe2"
style="height: 220px; width: 100%;" scrolling="no"/>
</div>
</div>
</div>
</body>
</html>
La solution
Au lieu de:
<iframe [...]/>
Essayez:
<iframe [...]></iframe>
Je voudrais vérifier cette question pour plus d’informations sur les raisons de cette solution: Pourquoi les balises de script à fermeture automatique ne fonctionnent-elles pas?
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow