onsa
12/20/2016 - 10:32 AM

Background video formatting

Background video formatting

body {
  margin: 0;
}

video {
  position: absolute;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center center;
}
body {
  margin:0;
  padding:0;
  overflow:hidden;
}

video {
  width:100%;
  height:auto;
}
body {
  margin:0;
  padding:0;
  overflow:hidden;
}
  
var video = document.querySelector("#video");
  video.width = window.innerWidth;
  video.height = window.innerHeight;
  window.onresize = function() {
  video.width = window.innerWidth;
  video.height = window.innerHeight;
};
html, body {
  color:white;
  height: 100%;
}

header {
  height: 100%;
  overflow: hidden;
}

header video {
  position: fixed;
  top:  50%;
  left: 50%;
  min-width:  100%;
  min-height: 100%;
  width:  auto;
  height: auto;
  z-index:  -100;
  transform:  translateX(-50%) translateY(-50%);
}