Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created October 1, 2018 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeaVerou/c4732bae3238d9cfce34797418ed209a to your computer and use it in GitHub Desktop.
Save LeaVerou/c4732bae3238d9cfce34797418ed209a to your computer and use it in GitHub Desktop.
Video & wrapper that never gets bigger than the viewport?
/**
* Video & wrapper that never gets bigger than the viewport?
* (Does not work right now. It resizes correctly for available width, but not available height)
*/
.media-frame {
border: 10px solid red;
width: fit-content;
max-width: 100%;
max-height: -webkit-fill-available;
}
.media-frame video {
max-width: 100%;
max-height: -webkit-fill-available;
background: yellow;
}
<div class="media-frame"><video src="https://mavo.io/demos/eshop/video.mp4" class="paused"></video></div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment