Youtube-Video richtig einbinden

…geht so:

CSS

.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 0;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

HTML

<div class="video-container"><iframe src="https://www.youtube-nocookie.com/embed/E4WR4utsONo?rel=0" allowfullscreen="allowfullscreen" frameborder="0"></iframe></div>

This entry was posted in Spiroublog. Bookmark the permalink.