I am trying to create a full-width iframe vimeo background covered by a pattern located in my body div. The video is covered by an overlay so it becomes unclickable. Ive tried giving the video 100% width and height yet no luck on covering the screen.. I am trying to have the videos pop up at 500x250 px.
Html
<div class="video">
<iframe src="//player.vimeo.com/video/82123812?title=0&byline=0&portrait=0&color=3a6774&autoplay=1&loop=1" width="960" height="540" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div class="overlay"></div>
</div>
CSS
.video {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%
}
.video .overlay {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: url(../img/overlay-pattern.png) repeat;
}
This solution replicates the css property
background-size: cover
, using an iframe instead of an image, in full CSS.First, put your vimeo iframe in a wrapper:
Then apply those styles:
In addition, in the case of Vimeo, a pro account gives you the ability to remove the player's controls.
You need to set the width and height of the iframe as well as its wrapper. I've also added some z-indexes for luck!
Hey diddle diddle, here is a fiddle: http://jsfiddle.net/n28Ef/1/