html - 视频 iframe 重叠内容 - html/css
问题描述
我有一个简单的 html 来显示视频,但它看起来不正确。下面是屏幕截图、HTML 和 CSS。如何阻止视频重叠并正确显示?
.video-responsive {
text-align: center;
overflow: hidden;
height: 0;
}
.video-responsive iframe {
margin: 0;
padding: 0;
height: 70%;
width: 70%;
display: block;
position: absolute;
}
<p>Watch the video recording to see the whole conference</p>
<div class="video-responsive">
<iframe width="320" height="240" src="https://www.youtube.com/embed/UHpaxaJ-GgU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
<p>If you have any questions, please email us at contact@metis.com</p>
解决方案
取下position: absolute
并height: 0
放在包装纸上。
.video-responsive {
text-align: center;
}
.video-responsive iframe {
margin: 0;
padding: 0;
height: 70%;
width: 70%;
display: block;
}
<p>Watch the video recording to see the whole conference</p>
<div class="video-responsive">
<iframe width="320" height="240" src="https://www.youtube.com/embed/UHpaxaJ-GgU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<br/>
<p>If you have any questions, please email us at contact@metis.com</p>
推荐阅读
- node.js - 通过对象 _id 查找的 Mongoose 文档
- java - Apple Silicon(M1) 11.4 出现 java 错误 (jdk16)
- linux - centos7.3安装docker失败
- r - 从R中的对象导出多个csv文件
- android - FAILED:device/asus/sdm660-common/audio_amplifier/Android.mk: error:audio_amplifier.sdm│·660:C_INCLUDES 必须在源或输出目录下
- datatable - 批量操作:当并非所有项目都支持某个操作时该怎么办
- android - 在我启动谷歌地图之前,这些功能不会返回设备的位置
- r - 将函数应用于因子(参与者)的每个级别,以根据 R 中标准差中的均值距离去除异常值
- javascript - 如何在无头 Chrome 中加快时钟速度
- python - Pandas Dataframe,为分组数据创建平均趋势,每个观察只有一个数据点