How can you be able to run a background video in html file? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can you be able to run a background video in html file?

Yes I do want some content in front of the video

28th Oct 2020, 7:44 PM
Josephine Oketch
Josephine Oketch - avatar
2 Answers
+ 2
What do you mean by "background video"? Do you want some content infront of the video? Do you want to hear the audio but not see any of the video? Have you tried a video tag like this? https://www.w3schools.com/howto/howto_css_fullscreen_video.asp If you want HTML content overlapping the video, some CSS would help. Using position: fixed for your foreground content and setting top, left, bottom, right should do the trick.
28th Oct 2020, 8:18 PM
Josh Greig
Josh Greig - avatar
+ 1
You can use embbed video tag. <video src="path/music.mp3 autoplay repeat><source type="type" src="file.type"></video> Then just add hidden attribute. style="visibility:hidden;"
28th Oct 2020, 11:00 PM
Marcelo Anjos
Marcelo Anjos - avatar