Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Adam Smallman
4,182 PointsEmbedded youtube video for mobile devices. I need help!
I have made a site that works perfect, the only problem is when I view it on mobile phone. I cannot scroll down over the embedded youtube video!!
I know its the video because I have deleted it and you can scroll down. The page wont scroll only if you place your finger on the video.
How can I fix this ?
Thanks
Adam
3 Answers

Jose Fremaint
2,885 PointsFirst you have to put the IFRAME inside a DIV and then style the DIV and the IFRAME with css.
Example:
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 35px;
height: 0;
overflow: hidden;
}
.video-container iframe {
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}

Adam Smallman
4,182 PointsStill didn't work its really frustrating
any idea ?

Jose Fremaint
2,885 PointsMaybe somebody with more experience will help, but I will keep searching.

Dave Hallett
5,257 PointsI've got exactly the same problem and have been looking online for answers for 2 days now. Has anyone managed to find a solution for this ?
Adam Smallman
4,182 PointsAdam Smallman
4,182 PointsHello Jose,
I have copied your code exactly, but its still not working.
I still cant scroll down on mobile phone.
Here is a link to the website http://tomshilcockcreative.com/showreel.php
On a desktop you can scroll down but not on mobile phone. I have placed a long red div under the video.
Jose Fremaint
2,885 PointsJose Fremaint
2,885 PointsAdd this css code to the parent DIV.
-webkit-overflow-scrolling:touch;