Answer the question
In order to leave comments, you need to log in
How to make youtube video responsive?
How to make a YouTube video block responsive so that black bars do not appear?
Answer the question
In order to leave comments, you need to log in
Habr. The simplest adaptive layout techniques :
<div class="video">
<iframe src="//www.youtube.com/embed/b7deZTDDEbs?rel=0&showinfo=0"
frameborder="0" allowfullscreen></iframe>
</div>
.video {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
}
.video iframe, .video object, .video embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question