Responsive Videos mit SCSS

BLOG

mit folgendem Code können Videos responsive eingebunden werden.

 

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  object, embed, video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
  }
} 

 

 

Die Idee ist eigentlich schon sehr alt, hier ein Artikel aus dem Jahre 2009

http://alistapart.com/article/creating-intrinsic-ratios-for-video