Fullscreen background video and keep it centered - HTML CSS CSS Property

HTML CSS examples for CSS Property:background

Description

Fullscreen background video and keep it centered

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

#video-wrap {<!--  ww w . j a va2 s .com-->
   position: fixed;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
}
#video {
   position: absolute;
   top: -9999px;
   bottom: -9999px;
   left: -9999px;
   right: -9999px;
   margin: auto;
   min-width: 100%;
   min-height: 100%;
   width: auto;
   height: auto;
}


      </style> 
 </head> 
 <body> 
  <div id="video-wrap"> 
   <video id="video" loop autoplay> 
    <source src="http://your .mp4" type="video/mp4"> Your browser does not support HTML5 video. 
   </video> 
  </div>  
 </body>
</html>

Related Tutorials