Исправлены элементы div и внутренние элементы iframe.

StackOverflow https://stackoverflow.com/questions/806086

  •  03-07-2019
  •  | 
  •  

Вопрос

У меня проблема с html-кодом.Я перепробовал много решений, но так и не решил свою проблему.Именно моя проблема в том;если бы я использовал два div внутри html-страницы, и оба div должны содержать элемент iframe, я никогда не видел правильную html-страницу в браузере.

Примечание :каждый div должен иметь атрибут CSS Position:fixed.

Пример кода:

<!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