Created
October 30, 2019 22:21
-
-
Save sulram/86153b8d0e1d9948b68316bb8609cade to your computer and use it in GitHub Desktop.
vimeo-html
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="vimeo-full"> | |
<iframe src="https://player.vimeo.com/video/355660592?background=1&autoplay=1&loop=1&byline=0&title=0" | |
frameborder="0" | |
webkitallowfullscreen | |
mozallowfullscreen | |
allowfullscreen> | |
</iframe> | |
</div> | |
<style> | |
.vimeo-full { | |
position: relative; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
z-index: -1; | |
pointer-events: none; | |
overflow: hidden; | |
} | |
.vimeo-full iframe { | |
width: 100vw; | |
height: 56.25vw; /* Given a 16:9 aspect ratio, 9/16*100 = 56.25 */ | |
min-height: 100vh; | |
min-width: 177.77vh; /* Given a 16:9 aspect ratio, 16/9*100 = 177.77 */ | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} | |
</style> |
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="vimeo-responsive"> | |
<iframe | |
src="https://player.vimeo.com/video/350129967?portrait=0" | |
frameborder="0" | |
allow="autoplay; fullscreen" | |
webkitallowfullscreen | |
mozallowfullscreen | |
allowfullscreen> | |
</iframe> | |
</div> | |
<style> | |
.vimeo-responsive { | |
padding: 56.25% 0 0 0; | |
position: relative; | |
} | |
.vimeo-responsive iframe { | |
position:absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment