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="http://slideaway.ru/sites/all/themes/slideaway_theme/slideaway_mainVol2.mp4" type="video/mp4">
</video>
</div>

Here is how it looks like:

A video in a background goes here

Tags: 
×

Hey! Don't miss a new cool stuff!

Comments

susanrichard (not verified)

Some people designed parade float that is very attractive. This is designed for oxford celebration parade. People worked hard for this float. We can find picture of this float on internet. This float is decorated and people https://www.assignmenthelperuk.co.uk used good material to design this.

asd (not verified)

The same kind of care needs with regard to applied to barefoot jogging. karamba Apply the steps I just suggested and will also be blessed with beautiful hair.

aftabak (not verified)

In this you should simply join with an online clubhouse site and store some measure of cash. hopa

Add new comment