Last active
March 25, 2019 23:16
-
-
Save JoelLisenby/6e2136b824fd202c5755889da281d0ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="hero_video_container"> | |
<video autoplay muted loop id="hero_video"> | |
<source src="/videos/video.mp4" type="video/mp4" /> | |
<source src="/videos/video.webm" type="video/webm" /> | |
</video> | |
</div> | |
<style> | |
#hero_video_container { | |
position: relative; | |
width: 100%; | |
height: 75vh; | |
max-height: 75vw; | |
overflow: hidden; | |
background: transparent url('/images/placeholder.png') no-repeat center center; | |
background-size: cover; | |
} | |
video#hero_video { | |
display: none; | |
position: relative; | |
width: 100%; | |
height: 100vw; | |
object-fit: cover; | |
} | |
@media only screen and (min-width: 1024px) { | |
video#hero_video { | |
display: block; | |
height: auto; | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment