iPad Safari mobile seems to ignore z-indexing position for html5 video elements

Marek Maurizio picture Marek Maurizio · Sep 10, 2010 · Viewed 30.5k times · Source

I got a video element on a page that's working fine both in safari mobile and desktop. I have a seme-transparent pull-down menu that's working fine. The problem is, when the menu is over the video element, on the desktop safari i can see the video under the menu (as desired), while on the mobile version the video element stay on the foreground (ugly) no matter what i tell the css. Is there any workaround?

An image of the problem

Answer

JaffaTheCake picture JaffaTheCake · Feb 4, 2011

The issue only occurs if the video element was dynamically created. If the element was just in the page as it loaded, z-index works fine.

You can fix z-index on dynamically created videos by giving the video element -webkit-transform-style: preserve-3d.

Yep, it's as bad as haslayout on IE!