9

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

Anybody know a fix for this?

Ryan Tuosto
  • 1,941
  • 15
  • 23

1 Answers1

11

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>
You knows who
  • 885
  • 10
  • 18
  • this is working in Firefox. but instead of the video it renders the player completely black... – Jules Colle Feb 17 '13 at 16:13
  • 1
    If it's black, that's probably because you have a bad url. If there's already a ? in the url, you want to add `&wmode=opaque` instead of the ? – Tom Aug 28 '13 at 16:22