How to add a video in a html div background

Posted by admin on Mon, 10/30/2017 - 13:53

How to add a video in a html background - muted and loop.

If you already have a mp4 video, just add a video tag with "playsinline autoplay muted loop" options.

<div style="position: relative;">
<h2 style="position: absolute; top: 20%; left: 10%; text-align: center; background: #FFF; padding: 40px;">A video in a background goes here</h2>
<video playsinline autoplay muted loop style="object-fit: cover;">
  <source src="" type="video/mp4">

Here is how it looks like:

A video in a background goes here


Hey! Don't miss a new cool stuff!


aftab ali (not verified)

The appropriate response A success demonstrating a group working strongly and not of individual prevalence.parimatch

Add new comment