Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Created January 11, 2023 22:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nocodesupplyco/a8f2c0f95111e175a384473fdf98c91f to your computer and use it in GitHub Desktop.
Vimeo Video as Background
.video-bg {
position: absolute;
left: 0%;
top: 0%;
right: 0%;
bottom: 0%;
z-index: 0;
overflow: hidden;
}
.video-bg_iframe {
position: absolute;
left: 50%;
top: 50%;
right: auto;
bottom: auto;
width: 100vw;
height: 56.25vw;
min-height: 100vh;
min-width: 177.77vh;
transform: translate(-50%, -50%);
}
<div class="video-bg">
<iframe src="https://player.vimeo.com/video/{{VIMEO-ID}}?background=1" class="video-bg_iframe" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment