Hello Friends, Today in this blog you’ll learn how to make a full screen video background in html css. Recently, I have shared a poll system in HTM & CSS. Now it’s time to create a how to make a full screen video background in html + css.
In the video, you’ve seen a video playing in the background auto with loop.There are many different ways to create this responsive fullscreen video background using html css,make a full screen video background html, one of which is the way we have designed it.
If you like this full screen video background in html css (Pricing Tables)and want to use it in your project you can freely copy & use it without any restriction, And you can take Pricing Tables to the next level with your creativity.
So to create these ,full-screen video background you need to create two different files. The 2 files are index.html & style.css files. Remember when you create an HTML file don’t forget to add a .html extension on HTML file and .css extension to your style file.
Let’s create a Cascading Style Sheet(CSS) file with the name of style.css and paste the below codes in your CSS file. Remember you’ve to create a file with a .css extension
*{
margin: 0;
padding: 0;
font-family: "Open Sans";
text-decoration: none;
}
.full-screen{
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;background: linear-gradient(0deg, rgba(68,68,68,0.5270483193277311) 0%, rgba(0,0,0,0.4962359943977591) 100%);
}
.full-screen video{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
}
.content h1 {
text-align: center;
font-size: 7vw;
color:#fff;
}
h1.aj_bg {
background: linear-gradient(
0deg, rgba(20,249,250,0.38139005602240894) 0%, rgba(255,237,70,0.4962359943977591) 100%);
}
Now create a (HTML) file with the name of index.html and paste the below codes in your HTML file. Remember you’ve to create a file with a .html extension
FULLSCREEN
VIDEO BACKGROUND
After creating these two files & pasting codes, now run the files in your browser. You can run to any browser you have on your computer. (Google Chrome, Firefox, Internet explorer etc.)
That’s all, now you’ve successfully created full screen video background in html css. If your code does have any bugs/errors/ or you’re facing any problems, then please comment down below or contact us from the contact us page.
Hope you enjoyed reading and watching the video. Please do like and subscribe to my youtube channel & follow me on Instagram.
Thanks in Advance!