开发者

Youtube iframes sitting on top of fixed position element in Chrome

开发者 https://www.devze.com 2023-03-27 19:07 出处:网络
In chrome youtube iframes float on top of my fixed position header.开发者_Go百科I\'ve tried setting z-indexes for both and its not happening.

In chrome youtube iframes float on top of my fixed position header. 开发者_Go百科I've tried setting z-indexes for both and its not happening.

Anybody know a fix for this?


When you embed a youtube iframe like this:

<iframe width="560" height="315" src="http://www.youtube.com/embed/FSHDDteCBXw" frameborder="0" allowfullscreen></iframe>

The default wmode will make the video overlay everything else, the solution is just add ?wmode=opaque in to the end of the src="http://www.youtube.com/embed/FSHDDteCBXw"

like this:

<iframe width="560" height="315" src="http://www.youtube.com/embed/FSHDDteCBXw?wmode=opaque" frameborder="0" allowfullscreen></iframe>
0

精彩评论

暂无评论...
验证码 换一张
取 消