Skip to content

Instantly share code, notes, and snippets.

@Perun
Created September 7, 2016 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Perun/0cacc3c76b0896043b5ca6df915bea86 to your computer and use it in GitHub Desktop.
Save Perun/0cacc3c76b0896043b5ca6df915bea86 to your computer and use it in GitHub Desktop.
Responsive iframes vzw. YouTube-Videos
<h1>Nich-responsive Einbindung</h1>
<div title="Kampf gegen ein Nazgûl im Westen von Gondor. Aufgenommen in Herr der Ringe Online.">
<iframe width="530" height="298" src="https://www.youtube.com/embed/KdI7EQsmlJs" frameborder="0" allowfullscreen></iframe>
</div>
<h1>Responsive Einbindung</h1>
<div class="video-block" title="Kampf gegen ein Nazgûl im Westen von Gondor. Aufgenommen in Herr der Ringe Online.">
<iframe width="530" height="298" src="https://www.youtube.com/embed/KdI7EQsmlJs" frameborder="0" allowfullscreen></iframe>
</div>
.video-block {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
height: 0;
overflow: hidden;
width: 100%; height: auto;}
.video-block iframe {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment