css - 如何在响应时防止 Youtube 视频溢出页面?
问题描述
HTML:
<div id="break" class="tabContent">
<div class="video-container">
<iframe src="https://www.youtube.com/embed/mj0XInqZMHY?autoplay=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; autoplay" allowfullscreen></iframe>
</div>
</div>
CSS:
.tabContent {
width: 100vw;
border-bottom: 1px dotted black;
}
.video-container iframe {
width: 100vw;
aspect-ratio: 16/9;
}
我正在尝试制作一个选项卡式部分,但我不知道如何防止视频溢出并强制滚动条。如何使视频完美契合,以使页面不会溢出并具有响应性?
解决方案
推荐阅读
- gcc - GCC DLL 使用完整文件路径转发导出
- javascript - 从 React Hook 复制数组
- google-cloud-platform - 我的虚拟机是否使用 GPU、承诺 GPU 和抢占式 GPU?
- node.js - Node.js 集群共享缓存
- c# - 为什么在没有序列化程序的情况下使用 Newtonsoft Json 进行驼峰化?
- java - .txt 文件上的 Java 正则表达式
- node.js - 将 SSE 与 NodeJ 一起使用时的多个 http 请求
- outlook - 调用 Outlook 加载项时不能选择超过 1 封电子邮件
- javascript - 无法使用 Thymeleaf 从 Html 中找到相关的 JS
- c# - 如何使用 C# regex for elasticsearch 将 json 格式句子转换为另一种格式?