Fullscreen Background Video Using HTML5 And CSS

You know very well play background video is a modern way to show your website in front of your users and clients when user visit and view your website a video is playing in the background of your website without disturbing its content and that makes your website very beautiful, attractive and different. So, in this tutorial we will show you how to add fullscreen background video using HTML5 and CSS.

HTMl code for play background video

<div class="video-container">
	<video autoplay loop muted id="video-bg">
		<source src="http://www.employastar.com/wp-content/themes/employastar/media/Meeting-Room.mp4" type="video/mp4" />
	</video>
</div>

CSS code for play background video

<style>
#myVideo{
	position: relative;
	right: 0; bottom: 0;
	min-width: 100%;
	min-height: 100%;
	z-index:9;
	overflow-x:hidden;
}
#video-bg{
	position: relative;
	width: auto;
	min-width: 100%;
	height: auto;
	background: transparent url(video-bg.jpg) no-repeat;
	background-size: cover;
}
video{display: block;}
.video-container{
	width: 100%;
	overflow: hidden;
	position: fixed;
	top: 0; right: 0;
	z-index: -100;
}
</style>

Article Name: Fullscreen Background Video Using HTML5 And CSS
Publish Date: 08-08-2018
Google Tags: video background css tricks, css video background div, background video html css, responsive video background, bootstrap background video, html5 video background examplesm, youtube video background html5, css background video cover

About Author

My name is Mukesh Jakhar and I am a Web Application Developer and Software Developer, currently living in Jaipur, India. I have a Master of Computer Application in Computer Science from JNU Jaipur University. I loves to write on technology and programming topics. Apart from this, I love to travel and enjoy the beauty of nature.

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.