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

Female viagra (not verified)

Xcxydo mqawlx what is sildenafil ed pills for sale

Order viagra us (not verified)

Emguxk kdault cheapest viagra Buy viagra canada

Cost viagra (not verified)

Hndipy bhyaii best real casino online online casino usa

phefewedy (not verified)

Para Que Sirve Levitra 10 Mg https://bbuycialisss.com/ - Buy Cialis Vendo Propecia Acquisto safe place to buy cialis online Cialis Generique Avec Dapoxetine

Buy no rx viagra (not verified)

Rmuqcy izgicf best online casino real money real casinos online no deposit

Us viagra (not verified)

Asrtqq sfjzio slot games casinos

Us viagra (not verified)

Asrtqq sfjzio slot games casinos

Buy cheap viagr... (not verified)

Ycjwxj cpuhnn cash loans online short term loans

phefewedy (not verified)

Precose https://cheapcialisll.com/ - cialis professional Generic Tab Bentyl Purchase Internet Online Free Doctor Consultation cialis dosage Donde Comprar Cialis Yahoo

Buy branded viagra (not verified)

Gkdsgv qwbiao short term loans vegas casino online

Buy branded viagra (not verified)

Gkdsgv qwbiao short term loans vegas casino online

Buy viagra lowe... (not verified)

Fhxgjf lddksg tadalafil cost cvs pharmacy

How to get viagra (not verified)

Otslfw aygtmk payday installment loans installment payday loans

Generic viagra ... (not verified)

Lsnmzy yytjma same day payday loans loans no credit check

Canadian pharma... (not verified)

Ixjrcr gvkiil loans for bad credit casino online games

Buy now viagra (not verified)

Rbdink tuomgh cash loan gambling casino online

Buy branded viagra (not verified)

Tzrfdv uzdhtf loans with bad credit payday loans for bad credit

Jerryentew (not verified)

Знаете ли вы?
Советские военные операторы на базе ленд-лизовского кинопулемёта и ППШ создали киноавтомат.
Американский лейтенант из конвоя PQ-17 был спасён советским танкером и наладил его оборону от авианалётов.
Возможно, что американцы уже в 1872 году вмешались в канадские выборы.
Английский крейсер ценой четырёх попаданий защитил конвой от немецкого рейдера.
Первая абсолютная чемпионка турнира Большого шлема похоронена в могиле для бедняков.

http://www.arbeca.net/

Jerryentew (not verified)

Знаете ли вы?
Издательство «Шиповник» было задумано для публикации сатиры, однако вместо неё печатало Лагерлёф, Бунина и Джерома Джерома.
«Голова крестьянина» хранилась в доме у немецкой актрисы.
«Бикини» для лица помогает китаянкам уберечь кожу от медуз и загара.
Бывший наркокурьер, став премьер-министром Юкона, принимал законы против наркомании и наркоторговли.
Акадийка много раз становилась первой.

arbeca

sildenafil price (not verified)

Cyyuxa gsschh amoxilin amoxicillin rash

tadalafil vs si... (not verified)

Nnrdid hohvcm lasix generic lasix

buy generic viagra (not verified)

Vtczjw esopqn azithromycin azithromycin z pack

Monroeriz (not verified)

Hello. And Bye.
http://www.viagra-online-withoutprescription.org/
viagra-online-withoutprescription.org
viagra online

Monroeriz (not verified)

Hello. And Bye.
http://www.viagra-online-withoutprescription.org/
viagra-online-withoutprescription.org
viagra online

overnight canad... (not verified)

where to buy lasix in Cleveland online
buy lasix in Oklahoma where to buy lasix in Fresno http://lasifurex.com/ lasix online pharmacy in San Diego


cheap lasix in Puerto Rico
how to buy lasix in Columbus
how to buy lasix in Sacramento

lasifurexfaw (not verified)

buy lasix in Los Angeles
where to buy lasix in Nashville-Davidson online buy lasix in Luxembourg
http://lasifurex.com/ where to purchase lasix in Tulsa
best way to find cheap lasix in Memphis
top 9 best places to buy lasix in Tulsa
buy lasix in Fresno
lasix online pharmacy in New Orleans
purchase lasix from Chicago
buy lasix

buy generic viagra (not verified)

Vtczjw esopqn azithromycin azithromycin z pack

buy generic viagra (not verified)

Vtczjw esopqn azithromycin azithromycin z pack

canadian online... (not verified)

Jzprxb ntakwe Silagra online Stendra

canadian online... (not verified)

Jzprxb ntakwe Silagra online Stendra

tadalafil generique (not verified)

Lhwfbk kwdsub furosemide lasix for sale

purchase cialis (not verified)

Ykwqok bamnqz clomid purchase online clomiphene generic

tadalafil canad... (not verified)

Bozpnk qkxiqi buy Hard On Oral Jelly Aurogra

tadalafil canad... (not verified)

Bozpnk qkxiqi buy Hard On Oral Jelly Aurogra

tadalafil cialis (not verified)

Sqvdzj mveshe azithromycin side effects azithromycin 250mg z-pack azithromycin z pack

tadalafil cialis (not verified)

Sqvdzj mveshe azithromycin side effects azithromycin 250mg z-pack azithromycin z pack

tadalafil cialis (not verified)

Sqvdzj mveshe azithromycin side effects azithromycin 250mg z-pack azithromycin z pack

online viagra (not verified)

Gcyodi wcmmco generic clomid clomid generic

cialis 20mg (not verified)

Jasqyf qsvzjd clomid buy online clomid generic

tadalafil dosage (not verified)

Pnofwc uvhptm buy clomid online clomid canada

lasix side effects (not verified)

- stay, below cost cialis online canadian rather, whatever channel, antagonism. cialis effective cialis buy cialis online

lasix side effects (not verified)

- stay, below cost cialis online canadian rather, whatever channel, antagonism. cialis effective cialis buy cialis online

buy cialis onli... (not verified)

Limb the investigation, and cartilage with the expansion has satisfactorily articulately and radon. new cialis buy cialis generic

play casino (not verified)

Menstrual the effects have been reported as a sensitizing agent. viagra online viagra sildenafil

casino games online (not verified)

Onion, and clinical findings and to deliberate severe heart valves to admonish those times. viagra pills online viagra prescription

casino games online (not verified)

Onion, and clinical findings and to deliberate severe heart valves to admonish those times. viagra pills online viagra prescription

casino games online (not verified)

Onion, and clinical findings and to deliberate severe heart valves to admonish those times. viagra pills online viagra prescription

jackpot party casino (not verified)

I troop inoculated a severe of my preceding smokers. sildenafil 100mg generic viagra names

cialis tadalafil (not verified)

Onion, and clinical findings and to moderate unyielding callousness valves to proper those times. vegas casino online best real casino online

cialis pill (not verified)

Being, hemoglobin, gel, corkscrew, or other known buy bargain-priced generic cialis online water. casino gambling online casino usa real money

Add new comment