Skip to content

Instantly share code, notes, and snippets.

@kn0ckkn0ck1
Created October 18, 2018 13:06
Show Gist options
  • Save kn0ckkn0ck1/e559cf745fa97b5bd25aca2421ad5b7b to your computer and use it in GitHub Desktop.
Save kn0ckkn0ck1/e559cf745fa97b5bd25aca2421ad5b7b to your computer and use it in GitHub Desktop.
Full screen video using the Viewport Units // source https://jsbin.com/henaruv
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Full screen video using the Viewport Units</title>
<style id="jsbin-css">
body {
margin: 0;
}
video {
position: absolute;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: center center;
}
</style>
</head>
<body>
<video src="https://mainline.i3s.unice.fr/mooc/big_buck_bunny_1080p_stereo.ogg" autoplay></video>
<script id="jsbin-source-css" type="text/css">body {
margin: 0;
}
video {
position: absolute;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: center center;
}
</script>
</body>
</html>
body {
margin: 0;
}
video {
position: absolute;
width: 100vw;
height: 100vh;
object-fit: cover;
object-position: center center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment