Youtube的iframe嵌入了HTML元素 [英] Youtube's iframe embeds cover up html elements

查看:301
本文介绍了Youtube的iframe嵌入了HTML元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在我的示例网站顶部的一个工具栏上工作:



http://theplagueround.com/dev/ b
$ b 但它隐藏在任何YouTube视频内容之后。我已经看过一两个关于向标签添加参数的信息,但是YouTube现在也在使用iframe,因此不适用。

解决方案

要在工具栏后面显示Youtube视频,您应该将参数wmode = transparent添加到URL的末尾。



所以改变这个:

 < iframe width =425 height =349
src =http://www.youtube.com/embed/H1Opn4DS88k
frameborder =0allowfullscreen>< / iframe> b




< iframe width =425height =349
src =http://www.youtube.com/embed/H1Opn4DS88k?wmode=transparent
frameborder = 0allowfullscreen>< / iframe>

更多信息:



如果你不想将HTML硬编码到您的帖子中,您应该使用@Tubal Martin提供的插件。这样做的好处是,如果Youtube将来更新他们的嵌入代码,则只需要将插件升级到最新版本即可。


i've been working on a toolbar at the top of my sample website:

http://theplagueround.com/dev/

but it gets hidden behind any youtube video content. i've seen a post or two about adding parameters to the tag, but youtube is also using iframes now so that doesn't apply.

解决方案

To have a Youtube video appear behind your toolbar, you should add the parameter wmode=transparent to the end of the URL.

So change this:

<iframe width="425" height="349" 
    src="http://www.youtube.com/embed/H1Opn4DS88k" 
    frameborder="0" allowfullscreen></iframe>

to this:

<iframe width="425" height="349" 
    src="http://www.youtube.com/embed/H1Opn4DS88k?wmode=transparent"     
    frameborder="0" allowfullscreen></iframe>

More here:

If you don't want to hardcode the HTML into your posts, you should use a plugin like the one provided by @Tubal Martin. This has the advantage that if Youtube update their embed code in the future, you should only need to upgrade the plugin to the latest version.

这篇关于Youtube的iframe嵌入了HTML元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆