Hello coders, In this blog, you will learn to add background video in HTML. We will add a background video with the help of a video tag. The video will continuously run in the background once the user comes to your website. Let’s learn about it in detail:-
![Background Video in HTML](https://codeblockx.com/wp-content/uploads/2023/01/codeblockx-28-768x432.png)
To add a background video in HTML, create a File with an HTML extension and write all the basic HTML tags in it. Which are head, body, title, Html, and doctype. After writing this we will add a video tag in the Body section.
After adding the video tag in the body section we will add autoplay, loop & muted attributes to it. In the src tag of the video type the address of the video. Your background video code HTML is ready. If you want to add more content in the Body tag then add it and save your file with the same extension.
We will also add a CSS style sheet to it in the style tag under the head section. You can either use the same sheet or can customize it with your choice.
The code to add background video in HTML is:-
Index.html
OUTPUT
Hope this blog was helpful to you and you got the answer to your question. You can also add Audio in HTML if you want to add it but don’t know how to then visit our detailed blog on it.
Thank you for visiting our blog. If you have any doubts about any coding questions then let us know in the comments section we will answer them as soon as possible.