css - 引导网站,嵌入 iframe (youtube) 溢出并阻止其他内容
问题描述
正如标题所说,我已经在我的页面上嵌入了一个 youtube 视频,在调整页面大小时,其余内容是响应性和适应的,而 youtube 框架不会,溢出并阻止网站上的其他内容。
如果可能的话,我想让它具有响应性,但主要是我只想让它这样没有什么可以阻止内容并添加某种分隔符。
在 bootstrap/html/css 上真的很新,所以如果这是一个很容易解决的问题,我很抱歉,我只是愚蠢,任何和所有的帮助,谢谢。
问题视频:https ://puu.sh/CsDP4/c5f221c22e.mp4 代码:
<div class="bg container-fluid text-center" id="GFX">
<div class="text-center title">
<h1>GFX</h1>
</div>
<hr/>
<div class="container-fluid overflow-hidden">
<iframe src="https://albumizr.com/a/TO-n" scrolling="yes" frameborder="0" allowfullscreen width="700" height="700"></iframe>
</div>
<hr/>
</div>
<hr>
<div class="bg embed-responsive-16by9 text-center" id="Video">
<div class="text-center title">
<h1>Video Editing</h1>
</div>
<hr/>
<div class="container-fluid overflow-hidden">
<iframe class="text-center embed-responsive-item " width="1280" height="720" src="https://www.youtube-nocookie.com/embed/videoseries?list=PLwf6BHzjcncmOoDkyKM8PNAnYhRHkbXub" frameborder="0" autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<hr/>
</div>
<hr/>
<br>
<div class="bg container-fluid text-center" id="Music">
<div class="text-center title">
<h1>Music Production</h1>
</div>
<hr/>
<div class="container-fluid overflow-hidden">
<iframe class="text-center" width="100%" height="auto" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/677510388%3Fsecret_token%3Ds-q8lC3&color=%230d58e7&auto_play=false&hide_related=false&show_comments=false&show_user=true&show_reposts=false&show_teaser=true"></iframe>
</div>
<hr/>
</div>
<hr/>
解决方案
您可以max-width
在 iframe 中使用,以便响应。
iframe {
max-width: 100%
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head>
<body>
<div class="bg container-fluid text-center" id="GFX">
<div class="text-center title">
<h1>GFX</h1>
</div>
<hr/>
<div class="container-fluid overflow-hidden">
<iframe src="https://albumizr.com/a/TO-n" scrolling="yes" frameborder="0" allowfullscreen width="700" height="700"></iframe>
</div>
<hr/>
</div>
<hr>
<div class="bg embed-responsive-16by9 text-center" id="Video">
<div class="text-center title">
<h1>Video Editing</h1>
</div>
<hr/>
<div class="container-fluid overflow-hidden">
<iframe class="text-center embed-responsive-item " width="1280" height="720" src="https://www.youtube-nocookie.com/embed/videoseries?list=PLwf6BHzjcncmOoDkyKM8PNAnYhRHkbXub" frameborder="0" autoplay; encrypted-media; gyroscope; picture-in-picture allowfullscreen></iframe>
</div>
<hr/>
</div>
<hr/>
<br>
<div class="bg container-fluid text-center" id="Music">
<div class="text-center title">
<h1>Music Production</h1>
</div>
<hr/>
<div class="container-fluid overflow-hidden">
<iframe class="text-center" width="100%" height="auto" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/677510388%3Fsecret_token%3Ds-q8lC3&color=%230d58e7&auto_play=false&hide_related=false&show_comments=false&show_user=true&show_reposts=false&show_teaser=true"></iframe>
</div>
<hr/>
</div>
<hr/>
</body>
<!-- Scripts are here -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</html>
推荐阅读
- java - 将类文件(字节)解压缩到 ASM ClassNode
- latex - 如何使用 Latex 引用指向共享文件夹的链接?
- visual-studio-code - 在 VS Code 中从集成终端打开文件
- mongodb - MongoDB 文本搜索找到长字符串,但没有找到短字符串?
- c++ - 当我使用变量(例如 x)时,机器如何知道这个变量的地址
- c# - DataContext 属性值如何被孩子而不是其他人继承?
- python-3.x - 将 JPEG blob 转换为图像
- kiwi-tcms - 测试进度显示 0% 完成
- wamp - 将站点添加到本地主机虚拟主机时出现问题
- c# - 如何从谷歌 API Json Response c# 为变量赋值