S
S
Seva2013-10-23 18:54:19
iPhone
Seva, 2013-10-23 18:54:19

Adaptive layout, Youtube and iPhone

Good afternoon, ladies and gentlemen.

I am doing a test. One of the points is to insert a youtube video page so that its size changes depending on the screen size.
In desktop browsers, it works great at any window size.

In the iPhone browser, the following is obtained - (full size by click). What could be the reason? Code - Thanks!

Image #1967472, 406.8 KB



Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
flight, 2013-10-23
@Zewkin

I have the same crap in Chorme.
.video {
position: relative;
padding-bottom: 56.25%
height: 0;
overflow: hidden;
margin-bottom: 20px
padding: 10px 0 - remove this line and everything will be ok
}

D
Dmitry Davydov, 2015-11-17
@dimadv7

Read it here: smartlanding.biz/adaptivnoe-youtube-video.html
There are details, and if quickly, then:

<div class="videoWrapper">;
   <iframe width="560" height="315" src="https://www.youtube.com/embed/ELYrAPHxEuI" frameborder="0" allowfullscreen&gt;&lt;/iframe>
</div>

And in css:
.videoWrapper{
  position:relative;
  padding-bottom:56.25%;
  padding-top:30px;
  height:0;
  overflow:hidden;
}
 
.videoWrapper iframe,.videoWrapper object, .videoWrapper embed{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question