65.9K
CodeProject is changing. Read more.
Home

Embedded YouTube videos z-index problem while playing

Jan 29, 2013

CPOL
viewsIcon

12040

Embedded YouTube videos z-index problem while playing.

Problem Description 

If you come across embedding YouTube videos to your website, you might know this problem. When some elements in your page have a higher z-index to float on other elements, the YouTube embedded video ignores their z-index and hides them under it. 

Tip 

A simple way to solve this is to add the wmode=transparent property to the source URL of the video: 

<iframe width="752" height="425" src="http://www.youtube.com/embed/O2R-ixfQtwE?wmode=transparent&rel=0&modestbranding=1" 
  frameborder="0" allowfullscreen=""></iframe>