【发布时间】:2019-01-06 17:12:20
【问题描述】:
我想将 iframe 放在我的页面上,并在 iframe 顶部放置另一个 div 以返回特定页面,但是,我似乎无法让 iframe 全屏显示(高度:100% 和宽度: 100%)。有什么办法可以让 iframe 全屏显示?
我已经尝试使用 jquery 将高度设置为窗口高度,但是它不起作用。
<style>
iframe {
height:100%;
width:100%;
}
.goback {
width:100%;
background-color:transparent;
transition:.5s;
position: absolute;
z-index:3;
}
.goback img {
padding:5px;
}
.goback:hover {
background-color:white;
}
</style>
<body>
<div class="goback">
<img src="../../assets/goback.png" alt="goback" height="50px" width="50px" />
</div>
<iframe src="https://music.youtube.com/"></iframe>
</body>
【问题讨论】:
标签: html css iframe fullscreen