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="" frameborder="0" allowfullscreen></iframe>
<div id="vidtop-content">
<div class="vid-info">
	  <h1>YouTube background here!</h1>

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-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!


Choiree (not verified) - best generic cialis

Lyclolf (not verified) - ivermectin 3mg price

railllync (not verified)


Choiree (not verified) - Cialis

buy canadian fi... (not verified)

Carlis Tadalafil Soft Tablets

Viagra (not verified)

se puede tomar viagra despues de un infarto

Smandajax (not verified) - 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) - Propecia

Smandajax (not verified) - Viagra

cialis prescrip... (not verified)

Motilium Without A Perscription

Smandajax (not verified) - Viagra

propecia hair growth (not verified)

Viagra order a prepaid visa

Lyclolf (not verified) - Stromectol

Henrytrief (not verified)

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

gasiart (not verified) - propecia vs generic finasteride

Propecia (not verified)

Cipan Portugal Amoxicillin

Lyclolf (not verified) - Stromectol

Stromectol (not verified)

cialis female libido

Lyclolf (not verified) - Stromectol

Choiree (not verified) - Cialis

buy cialis (not verified)

Generika Levitra Rezeptfrei

TeabsbevE (not verified)


Cigilleby (not verified)


Choiree (not verified) - buy cialis online in usa

Lyclolf (not verified) - 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) - Zithromax

abejessah (not verified)

plaquenil for sjogrens

ethipvoto (not verified)


Envecehem (not verified)

furosemide and potassium

Priligy (not verified)

Meds Similar To Doxycycline

Plaquenil (not verified)

Feline Amoxicillin Reactions

Envecehem (not verified)


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) - 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) - plaquenil alternatives

Add new comment