Skip to content

Instantly share code, notes, and snippets.

@tyidnet
Created June 7, 2021 18:07
Show Gist options
  • Save tyidnet/4564bb5db8c1a612d3b5c44820277a4b to your computer and use it in GitHub Desktop.
Save tyidnet/4564bb5db8c1a612d3b5c44820277a4b to your computer and use it in GitHub Desktop.
<style>
body { margin: 0; }
.vimeo-container {
padding: 0;
width: 100%;
height: 100vh;
overflow: hidden;
position: relative;
}
iframe {
box-sizing: border-box;
width: 177.77777778vh;
height: 56.25vw;
min-width: 100%;
min-height: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<div class="vimeo-container">
<iframe src="https://player.vimeo.com/video/[videoId]?api=1&background=1&autoplay=1&loop=1" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
</div>
@federicocappellotto97
Copy link

You really deserve a bug hug, the only working snippet of the entire web. Thanks!

@Web-Assembler
Copy link

I second this, you are a life-saver on a project - Huge thanks!

@m-hertig
Copy link

this is fantastic. thanks a lot!

@DevYemi
Copy link

DevYemi commented Dec 17, 2024

God bless you, i was almost considering moving to Cloudinary.

@fvenuto
Copy link

fvenuto commented Dec 19, 2024

Thanks!!! This code is really life-saver!!

@dinucciagustina
Copy link

thanks a loooot!! it really works!

@alldayalone
Copy link

TRUE HERO

@joangavelan
Copy link

GREAT!

@Jhongt796
Copy link

4 years later this is still a great trick, I've been looking at the best way to do this for a few hours, a reddit forum sent me here, thanks!

@rogue-hacker
Copy link

thank you thank you thank you, I've been trying to do this myself for so many years. you are a hero!

@codeway
Copy link

codeway commented Mar 19, 2025

Thanks you for the share 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment