M
M
mih_max2015-10-14 23:14:45
HTML
mih_max, 2015-10-14 23:14:45

How to make youtube videos responsive?

How to make the adaptability of videos inserted on the site from youtube?
Tried

.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%;
}

<div class="video"><iframe src="..." width="700" height="450" frameborder="0"></iframe></div>

Does not help(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Barsukov, 2015-10-15
@slavabars

<div class="video"><iframe src="..." width="100%" height="100%" frameborder="0"></iframe></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question