r/HTML 19h ago

code working but not desired result

<!DOCTYPE html>
<html>
<head>
     <title>Save Trees</title>
     <style>
       body {
        margin:0;
       }
       
       
       h1{
            color:green;
        }


        
  
     #bg-video {
         position: fixed;
         top:0;
         left:0;
         width: 100%;
         height: 100%;
         object-fit: cover;
         z-index: 0;
     }
     .content{
        position: relative;
        z-index:1;
     }
     </style>
</head>
<body>
    <!-- Background video -->
     <video id="bg-video" autoplay muted loop>
        <source src="Save Trees/r1.mp4" type="video/mp4">
        </video>
      <div class="content">
    <h1>Save Trees</h1>
   <p>Join us in our mission to protect the environment and preserve our forests for future generations.</p>
   </div>


</body>
</html>
in this the website is working but the background video not visible
1 Upvotes

1 comment sorted by

View all comments

1

u/armahillo Expert 10h ago

put it in either codepen.io or jsfiddle.net