on-internet
← Community

resize video proportionally to its container

Stack Overflow ·

I need to set up a video width/height accordingly to its container. Basically the video should have height 100% of its green container and the width should be variable. plyr.setup(); body { margin: 0; } .plyr { height: 100%; width :100%; } #wrapper{ display: flex; justify-content:center; width: 900px; height: 500px; background-color: green; } <script src="https://cdn.plyr.io/2.0.11/plyr.js"></script> <div id="wrapper"> <div> <div data-type="youtube" data-video-id="5p-Jdjo7sSQ"></div> </div> </div>

Comments

Sign in or sign up to comment and upvote.

No comments yet.