Created
December 4, 2015 08:47
-
-
Save ariona/f399adf129ecc18af001 to your computer and use it in GitHub Desktop.
Minimal CSS to create background video
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
/* | |
* This method can be applied to video tag and | |
* can be applied to iframe video like youtube, but with some issue to be considered | |
*/ | |
video{ | |
/* Centering the video */ | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translateX(-50%) translateY(-50%); | |
/* Below Props will stretch the video size */ | |
min-width: 100%; | |
min-height: 100%; | |
/* Below props will keept the aspect ratio */ | |
width: auto; | |
height: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment