How to make a YouTube embed video responsive using CSS

Posted by admin on Sat, 02/10/2018 - 08:33

Quick snippet how to make a youtube embed video responsive by CSS only.

The easiest way, using viewport units (IE9+)

iframe {
    width: 100vw; 
    height: 56.25vw; /* 100/56.25 = 560/315 = 1.778 */

CSS2 style fix using a CSS trick and wrapper with class .aspect-ratio:

    .aspect-ratio {
      position: relative;
      width: 100%;
      height: 0;
      padding-bottom: 56%; /* The height of the item will now be 56% of the width. */
    /* Adjust the iframe so it's rendered in the outer-width and outer-height of it's parent */
    .aspect-ratio iframe {
      position: absolute;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;

Check here:


Hey! Don't miss a new cool stuff!


Ndpita (not verified)

generic viagra in canada - vitality ed pills

Ttaxpe (not verified)

levitra price - best pills for ed

Solvsz (not verified)

vardenafil canada - vardenafil 20mg ed pills for sale

Gracjj (not verified)

sildenafil sample - generic drugs

Obcotw (not verified)

sildenafil discount - online canadian pharmacy review

Fuholt (not verified)

tadalafil buy - tadalafil pills cialis online pharmacy

Lcwdhm (not verified)

tadalafil online reviews - canadian family pharmacy

Jeoek (not verified)

online canadian pharmacy review - generic ed drugs

Jwyron (not verified)

brand viagra - walgreens pharmacy

Jsnamg (not verified)

buy viagra cheap - viagra no prescription canadian pharmacy sarasota

Onogui (not verified)

us discount viagra overnight delivery - Pfizer viagra canada canada drugs reviews

Aistky (not verified)

generic cialis tadalafil 20mg - vyvanse canadian pharmacy

Jdozh (not verified)

cialis daily generic - Cialis free delivery walmart pharmacy

Ycxlav (not verified)

ocean casino online - is canadian pharmacy legit

Xwfces (not verified)

cialis online buying - canadian pharmacy sildenafil

Ukowcl (not verified)

empire city casino online - costco online pharmacy

Bdrwd (not verified)

win real money online casino for free - online pharmacy

Zfjal (not verified)

buy generic fexofenadine online - buy ventolin inhalator online ed pills online

Dgjkad (not verified)

cheap essay online - online thesis writing pharmacy online store

Bmdukm (not verified)

loratadine - best online canadian pharmacy

Hbgnsk (not verified)

what is an antibiotic - canadian pharmacy generic levitra

Nqpuw (not verified)

buy bv antibiotics - canadian online pharmacy no prescription

Fliksh (not verified)

iv antibiotics - chloramphenicol online canadian pharmacy reviews consumer reports

Mlmjfj (not verified)

buy cialis online overnight shipping - canadian pharmacy review

Tblwuo (not verified)

us cialis - mail order prescription drugs from canada

Rmexb (not verified)

discount cialis online - cialis pricing canadian pharmacy online

Slolmu (not verified)

buy viagra colorado - canadian pharmacy cheap

Ihprpg (not verified)

best online viagra - canadian online pharmacy cialis

Cstblg (not verified)

cheapest generic viagra - levitra now pharmacy store

Vskox (not verified)

male erection pills - canadian pharmacy cialis reviews

Plvsno (not verified)

male ed pills - vipps canadian pharmacy

Lccmhs (not verified)

trusted online pharmacy reviews - trusted online pharmacy reviews

Rjufmb (not verified)

mexican pharmacy online - online canadian pharmacy review best canadian pharmacy online

Gldoc (not verified)

real money online casinos usa - gambling casino online canadian pharmacy sarasota

Trwyb (not verified)

free slots online - canadian pharmacies

Rlijft (not verified)

write essays for me - website to write essays canadian pharmacy ltd.

Iwacox (not verified)

buy a term paper online - paper writing online ed drug

Kphuva (not verified)

latest treatment for erectile dysfunction - keftab for sale canada pharmacy

Pzgrk (not verified)

play casino online - casino moons online casino canadian pharmacy scam

Mhdquz (not verified)

what are ed drugs - best erectile dysfunction pills ed treatment

Qvkcc (not verified)

slot machine games - casino online games hollywood casino online real money

Oboetk (not verified)

order research paper - buy term papers online

Qhlse (not verified)

college essay for sale - how to write a letter to a hiring manager

Ikcqu (not verified)

buy propecia online with prescription - site propecia testosterone levels

컴온 come on (not verified) (not verified)

viagra canada Rwcbtp rouffi (not verified)

best online pharmacy canadian pharmacy review Ovuovr bnenpc (not verified)

buy cialis pills Wmkbna cgvgoo (not verified)

liquid tadalafil Ckrfuj cxlpwa

Add new comment