Skip to content

Instantly share code, notes, and snippets.

@maxmzd
Created August 5, 2014 21:34
Show Gist options
  • Save maxmzd/00f790877f24d1e5be02 to your computer and use it in GitHub Desktop.
Save maxmzd/00f790877f24d1e5be02 to your computer and use it in GitHub Desktop.
.video-wrapper {
position: relative;
height: 100%;
width: 100%;
background: #ccc;
z-index: -1;
overflow: hidden;
video {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: auto;
overflow: hidden;
z-index: 2;
background: url('/img/feature-img.jpg');
background-size: cover;
background-color: rgba(255,255,255,0) !important;
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dppx) {
background: url('/img/[email protected]');
}
}
// Hide the video and show the image for smaller touch devices
@media (max-width: $break-medium) {
video { display: none; }
.img { display: block; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment