【发布时间】:2015-05-19 22:18:59
【问题描述】:
是否有无边框全宽视频的解决方案/教程?
我查看了一个现有的解决方案: Full-width vimeo wrapper background
我试过了,但是当我缩放到不同的视口大小时,我得到了不需要的(黑色)边框。
<div class="video">
<iframe src="https://player.vimeo.com/video/120893740?title=0& amp;byline=0&portrait=0&color=3a6774&autoplay=1&loop=1" width="960" height="600" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div
class="overlay">
<h1>HEADING HERE</h1>
<p>Content Here</p>
</div>
</div>
CSS:
body {
margin: 0;
padding: 0;
}
h1, p {
text-align: center
}
.video {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%}
.video iframe {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
}
.video .overlay {
position: absolute;
z-index: 2;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0);
}
提前致谢
【问题讨论】:
-
您想让视频填满整个页面吗?或者您只是希望大小保持不变但没有黑框??
-
也许可以让你在 .overlay 中的背景完全透明?
标签: html css twitter-bootstrap