Created
December 24, 2013 21:24
-
-
Save denisnazarov/8117906 to your computer and use it in GitHub Desktop.
Full screen (background) video with just CSS: http://jsbin.com/EzakOYIb/1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.full-screen-video-container{ | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
overflow: hidden; | |
} | |
.full-screen-video-container video{ | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
-webkit-transform: translateX(-50%) translateY(-50%); | |
-ms-transform: translateX(-50%) translateY(-50%); | |
transform: translateX(-50%) translateY(-50%); | |
min-width: 100%; | |
min-height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="full-screen-video-container"> | |
<video autoplay="autoplay" loop poster="http://media.w3.org/2010/05/bunny/poster.png"> | |
<source id="mp4" src="http://media.w3.org/2010/05/bunny/movie.mp4" type="video/mp4"> | |
<source id="ogv" src="http://media.w3.org/2010/05/bunny/movie.ogv" type="video/ogg"> | |
<p>Your user agent does not support the HTML5 Video element.</p> | |
</video> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment