Answers for "how to make video background css html"

CSS
1

css video background

.bg-vid {
  object-fit: cover;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}
Posted by: Guest on August-02-2021
-1

how to add video in html background

<video autoplay loop muted id="backgroundVideo">
  <source src="background.mp4" type="video/mp4">
</video>

<style>
	#backgroundVideo {
      position: absolute;
      right: 0;
      bottom: 0;
      min-width: 100%;
      min-height: 100%;
      overflow: hidden;
    }
</style>
Posted by: Guest on January-19-2022
-1

how to add video in background in html

How to create a full screen video background.
source: w3schools.com

<!-- The video -->
<video autoplay muted loop id="myVideo">
  <source src="backgroundVideo.mp4" type="video/mp4">
</video>

<!-- Optional: some overlay text to describe the video -->
<div class="content">
  <h1>Heading</h1>
  <p>Lorem ipsum...</p>
  <!-- Use a button to pause/play the video with JavaScript -->
  <button id="myBtn" onclick="myFunction()">Pause</button>
</div>
Posted by: Guest on March-01-2022

Code answers related to "how to make video background css html"

Browse Popular Code Answers by Language