【发布时间】:2018-05-28 22:14:03
【问题描述】:
我的(引导)网站上有一个响应式嵌入式 YouTube 视频。 当我选择 YouTube 全屏选项时,它可以在 Firefox 和 Chrome 上运行,但在 Safari 上它会短暂闪烁,然后全屏显示我整个网页的顶部,就好像 Safari 本身处于全屏模式一样。
CSS:
.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%; }
HTML:
<div class='embed-container'><iframe src='https://www.youtube.com/embed/myyoutubecode?rel=0' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
有没有人知道在 Safari 中进行这项工作的方法?
【问题讨论】:
标签: macos iframe youtube safari embed