我的html代码有问题。我尝试了很多解决方案,但我还没有解决我的问题。 我的问题很激动; 如果我在html页面中使用了两个div并且两个div必须包含iframe元素,我从未在浏览器中看到过正确的html页面。

注意:每个div必须具有position:fixed css attribute。

示例代码:

<!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>
有帮助吗?

解决方案

而不是:

<iframe [...]/>

尝试:

<iframe [...]></iframe>

我会查看这个问题,了解有关其原因的更多信息:为什么不要自动关闭脚本标签吗?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top