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

Mukesh Jakhar - PHP Web Developer
Mukesh Jakhar

This is Mukesh Jakhar. I’m a professional web developer with 3+ years experience. I am always ready for freelance work and i am writing blogs in my free time. I love to learn new technologies and share with others.

I founded PHPKIDA in September 2015. The focus of this website to provide web development tutorials of PHP, WordPress, CodeIgniter, Jquery, MySQL, HMTL, CSS etc and sharing solution to problems which i already solved.

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.