适用于 Prestashop 的响应式视频 Youtube
Responsive Video Youtube for Prestashop
我在 Prestashop 中包含视频时遇到问题!
这是我用来包含视频的代码:
<div class="videoWrapper">
<iframe width="640" height="360" src="https://www.youtube.com/embed/3G1PFLuTrgM" frameborder="0" allowfullscreen></iframe>
</div>
和 CSS:
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: auto !important;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
但是根本不起作用!
有人知道我能做什么吗?
谢谢!
更改默认内联宽度和高度:
<div class="videoWrapper col-md-12">
<iframe width="100%" height="450" src="https://www.youtube.com/embed/3G1PFLuTrgM" frameborder="0" allowfullscreen></iframe>
</div>
使用 Bootstrap 既有用又简单,请尝试使用 CSS(或保持默认值)向您的 iframe 添加高度
我在 Prestashop 中包含视频时遇到问题!
这是我用来包含视频的代码:
<div class="videoWrapper">
<iframe width="640" height="360" src="https://www.youtube.com/embed/3G1PFLuTrgM" frameborder="0" allowfullscreen></iframe>
</div>
和 CSS:
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: auto !important;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
但是根本不起作用!
有人知道我能做什么吗?
谢谢!
更改默认内联宽度和高度:
<div class="videoWrapper col-md-12">
<iframe width="100%" height="450" src="https://www.youtube.com/embed/3G1PFLuTrgM" frameborder="0" allowfullscreen></iframe>
</div>
使用 Bootstrap 既有用又简单,请尝试使用 CSS(或保持默认值)向您的 iframe 添加高度