How to add YouTube video as background using HTML

Posted by admin on Wed, 01/17/2018 - 10:46

Code snippet to add YouTube video as a background for you HTML tag.

Here goes your HTML:

<div class="video-background">
    <div class="video-foreground">
      <iframe src="https://www.youtube.com/embed/W0LHTWG-UmQ?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe>
    </div>
  </div>
 
<div id="vidtop-content">
<div class="vid-info">
	  <h1>YouTube background here!</h1>
  </div>
</div>

Here is your CSS (most of that just for beauty):

* { box-sizing: border-box; }
.video-background {
  background: #000;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -99;
}
.video-foreground,
.video-background iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#vidtop-content {
	top: 0;
	color: #fff;
}
.vid-info { position: absolute; top: 0; right: 0; width: 33%; background: rgba(0,0,0,0.3); color: #fff; padding: 1rem; font-family: Avenir, Helvetica, sans-serif; }
.vid-info h1 { font-size: 2rem; font-weight: 700; margin-top: 0; line-height: 1.2; }
.vid-info a { display: block; color: #fff; text-decoration: none; background: rgba(0,0,0,0.5); transition: .6s background; border-bottom: none; margin: 1rem auto; text-align: center; }
@media (min-aspect-ratio: 16/9) {
  .video-foreground { height: 300%; top: -100%; }
}
@media (max-aspect-ratio: 16/9) {
  .video-foreground { width: 300%; left: -100%; }
}
@media all and (max-width: 600px) {
.vid-info { width: 50%; padding: .5rem; }
.vid-info h1 { margin-bottom: .2rem; }
}
@media all and (max-width: 500px) {
.vid-info .acronym { display: none; }
}
×

Hey! Don't miss a new cool stuff!

Comments

Choiree (not verified)

https://buytadalafshop.com/ - best generic cialis

Lyclolf (not verified)

http://buystromectolon.com/ - ivermectin 3mg price

railllync (not verified)

Viagra

Choiree (not verified)

https://buytadalafshop.com/ - Cialis

buy canadian fi... (not verified)

Carlis Tadalafil Soft Tablets

Viagra (not verified)

se puede tomar viagra despues de un infarto

Smandajax (not verified)

http://buysildenshop.com/ - Viagra

Cigilleby (not verified)

cialis for sale

PatrickMok (not verified)

gay silver daddy dating site
gay bear teen dating
gay dating dragon age origins

PatrickMok (not verified)

gay big and tall dating
gay speed dating dallas tx
arab gay dating free

Viagra (not verified)

Baclofene Alcool Canada

injutty (not verified)

propecia generika 1mg

PatrickMok (not verified)

gay dating sites 2021
china gay dating services
hiv positive gay dating

Cigilleby (not verified)

cialis cheapest online prices

MichaelMot (not verified)

gay dating video
tirana gay dating
gay teenage dating site

Henrytrief (not verified)

gay dating sim for android
beste gay dating
dating a gay thug tips

gasiart (not verified)

http://buypropeciaon.com/ - Propecia

Smandajax (not verified)

https://buysildenshop.com/ - Viagra

cialis prescrip... (not verified)

Motilium Without A Perscription

Smandajax (not verified)

https://buysildenshop.com/ - Viagra

propecia hair growth (not verified)

Viagra order a prepaid visa

Lyclolf (not verified)

http://buystromectolon.com/ - Stromectol

Henrytrief (not verified)

are gay dating sites cheating
gay dating websites list
gay dating service

gasiart (not verified)

https://buypropeciaon.com/ - propecia vs generic finasteride

Propecia (not verified)

Cipan Portugal Amoxicillin

Lyclolf (not verified)

https://buystromectolon.com/ - Stromectol

Stromectol (not verified)

cialis female libido

Lyclolf (not verified)

https://buystromectolon.com/ - Stromectol

Choiree (not verified)

https://buytadalafshop.com/ - Cialis

buy cialis (not verified)

Generika Levitra Rezeptfrei

TeabsbevE (not verified)

Stromectol

Cigilleby (not verified)

Cialis

Choiree (not verified)

http://buytadalafshop.com/ - buy cialis online in usa

Lyclolf (not verified)

https://buystromectolon.com/ - Stromectol

Henrytrief (not verified)

gay dating service pittsburgh
free gay dating in india
gay 22 dating 18

ivermectin for sale (not verified)

Progesterone Website Pills C.O.D. No Prescription

Henrytrief (not verified)

gay single parent dating
international dating site gay
gay dating without sign up

Agobben (not verified)

http://buyzithromaxinf.com/ - Zithromax

abejessah (not verified)

plaquenil for sjogrens

ethipvoto (not verified)

Priligy

Envecehem (not verified)

furosemide and potassium

Priligy (not verified)

Meds Similar To Doxycycline

Plaquenil (not verified)

Feline Amoxicillin Reactions

Envecehem (not verified)

Lasix

Henrytrief (not verified)

younger for older gay dating
gay dating simulation game
gay local dating sites

Plaquenil (not verified)

Fluoxetine 60mg For Sale Medicine

Whasksaks (not verified)

https://buyplaquenilcv.com/ - plaquenil for sjogrens

Arerrot (not verified)

for sale zithromax z pak oral

Dbgvweack (not verified)

writing a dissertation dissertation help literature review

Whasksaks (not verified)

https://buyplaquenilcv.com/ - plaquenil alternatives

Add new comment