Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

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>
Source by blog.hubspot.com #
 
PREVIOUS NEXT
Tagged: #add #video #background #html
ADD COMMENT
Topic
Name
1+4 =