Created
December 13, 2016 22:28
-
-
Save coopermayne/f8b7d94560d6cc786c721882633217e5 to your computer and use it in GitHub Desktop.
CSS trick for getting a well centered video background to a div
This file contains hidden or 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
.video_contain { | |
position: absolute; | |
top: -50%; | |
left: -50%; | |
width: 200%; | |
height: 200%; | |
} | |
video { | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
right: 0; | |
left: 0; | |
margin: auto; | |
min-height: 50%; | |
min-width: 50%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment