Skip to content

Instantly share code, notes, and snippets.

@jonbrockett
Created January 17, 2019 14:38
Show Gist options
  • Select an option

  • Save jonbrockett/ece6353fd3d3c435016d804de3adbafa to your computer and use it in GitHub Desktop.

Select an option

Save jonbrockett/ece6353fd3d3c435016d804de3adbafa to your computer and use it in GitHub Desktop.
Hero Video
// Hero Video
.hero-video {
left: 50%; // To center video
transform: translate(-50%, 0); // To center video
min-width: 100%; // To stretch to the container
min-height: 100%; // To stretch to the container
position: absolute;
z-index: -1; // To drop behind content
}
<video class="hero-video" autoplay playsinline loop muted preload="none" poster="" style="background-image: url();">
<source src="" type="video/mp4">
</video>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment