Skip to content

Instantly share code, notes, and snippets.

@ClementParis016
Created February 9, 2016 15:04
Show Gist options
  • Save ClementParis016/980d6fc5cc62b684393d to your computer and use it in GitHub Desktop.
Save ClementParis016/980d6fc5cc62b684393d to your computer and use it in GitHub Desktop.
Fullscreen video background
video {
position: fixed; /* or absolute if fullscreen in parent */
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
-ms-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background: url(polina.jpg) no-repeat;
background-size: cover;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment