Skip to content

Instantly share code, notes, and snippets.

@Xavka
Last active May 6, 2018 12:47
Show Gist options
  • Save Xavka/aa17950686787a8ab03b to your computer and use it in GitHub Desktop.
Save Xavka/aa17950686787a8ab03b to your computer and use it in GitHub Desktop.
.fullscreen-bg {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
z-index: -100;
}
.fullscreen-bg__video {
position: absolute;
top: 50%;
left: 50%;
width: auto;
height: auto;
min-width: 100%;
min-height: 100%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
@media (max-width: 767px) {
.fullscreen-bg {
background: url('http://dev2.slicejack.com/fullscreen-video-demo/img/videoframe.jpg') center center / cover no-repeat;
}
.fullscreen-bg__video {
display: none;
}
}
@empirefx
Copy link

empirefx commented May 6, 2018

Nice example, i want to overlap with an image, i've tried this, but the image its not coming up

.fullscreen-bg__video,
.fullscreen-bg__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.fullscreen-bg__img{
	background: url('../images/background-theme.png') center center / cover no-repeat;
	z-index:-1;
}

.fullscreen-bg__video{
	z-index:-90;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment