因此,我使用我的website中的iFrame来显示视频,并将它放在div中以允许调整移动sties的大小,并使其更具响应性等。但是现在,如果显示器iframe中的内容被截断。缩放iframe以适当地适合
下面是IFRAME代码:
<div class="wrapper">
<iframe src="https://player.vimeo.com/video/132695239?badge=0" width="960" height="540" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<style>
.wrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.wrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
如果任何人都可以看到任何可能导致此行为那么我很想知道。
感谢
编辑: 这里是我试图缩放DIV的代码。宽度不会随着页面缩小而改变,因此高度也不会改变。 任何想法?
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='http://player.vimeo.com/video/66140585' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
我还没有尝试过,但你可能看看http://embedresponsively.com/ – bmurauer
@bmurauer感谢您的建议,但它基本上做同样的事情,问题没有解决。我无法向下滚动。 – dwinnbrown
你想在小屏幕上显示视频吗?还是包括标题在内的一切? – NateW