Skip to content

Instantly share code, notes, and snippets.

@Perun Perun/index.html

Created Sep 7, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.