我的网站https://saxobroko.gq具有多个div作为不同的窗口,当我删除div时,它们将停止适合整个页面。

我尝试使用css使其不使用iframe且仅使用<p>Test</p>进行整页显示

我希望iframe能够适合用户的视图,而不需要iframe。

编辑:我将包括之前和之后的代码。

之前(无效):

<style>
.sec1 {background-attachment: fixed;min-height: 100%;background-position: center;background-repeat: repeat-xy;}
</style>
<div class="sec1">
     <iframe src="#"></iframe>
</div>


之后(工作):

<style>
.sec1 {background-attachment: fixed;min-height: 100%;background-position: center;background-repeat: repeat-xy;width:100%;height: 101vh;}
</style>
<div class="sec1">
     <h1>Sec1 Test</h1>
</div>

最佳答案

尝试将此样式应用于类名称为iframdiv中。
例如 :

.sec4 w3-center > iframe {
   width: 100%
   height: 100vh;
}

关于html - 没有iframe的全屏div如何显示?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56286073/

10-12 07:40
查看更多