Z-Index and YouTube Videos … Overlapping Content Quandry

隐身守侯 提交于 2019-12-24 03:22:14

问题


I looked at other questions regarding z-index issues in stack overflow and I was not completely understanding the concept of adding information to the end of the URL of the youtube URL ... I couldnt figure out where to begin adding wmode or why I would add that ... i just want them to NOT flow over my navigation at the top of the page ... could someone recommend a fix for my youtube videos as I use embedded youtube videos extensively on my website and having z-index issues looks amateurish and I would rather have my videos running below my nav bars if that is at all posssible. I tried setting a div and dropping the z-index but I either did it wrong or that is not a definitive fix. Help would be appreciated the URL that I am having issue with is at ... http://www.nicholaslawson.com/youtube.com ... thank you for your time.


回答1:


It's a very simple fix. But add: ?wmode=opaque to the end of the url. for instance:

http://youtube.com/embed/IdG0e5h3re

would become

http://youtube.com/embed/IdG0e5h3re?wmode=opaque

i had the same issue a while ago!




回答2:


This is the code i used to embed a youtube video recently

<iframe width="640" height="390" src="https://www.youtube.com/embed/PlkWVkpP59U?rel=0&amp;modestbranding=1&amp;wmode=transparent" frameborder="0" allowfullscreen=""></iframe>

the ID PlkWVkpP59U is the only part you should need to change to change the video.

You can then treat the iframe as a normal element with z-index and whatever, although things typically just work once you do this



来源:https://stackoverflow.com/questions/10403124/z-index-and-youtube-videos-overlapping-content-quandry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!