So this is what i tried so far:
<div id="video" style="position:absolute;margin-top: 231px;margin-left: 127px;">
<video width="520" height="390" style="z-index:-10;">
<source src="m/video.ogv" type="video/ogg">
<source src="m/video.mp4" type="video/mp4">
</video>
</div>
I have a fixed menu and when the menu is over the video , the video just seem to ignore the z-index. Im currently working on chrome windows with no luck. Any ideas?
The overlay also needs to be a sibling of the video. It will not work if the video is a child of the overlay.
Works:
Dosen't Work:
I've only tried this in Chrome so apologies if this isn't universally true.
On your overlay/menu element, use:
This worked for me. My guess is that it triggers 3d rendering on the element, which eliminates the z-index problem.
Use css
position:absolute
property to both elements which overlaps and try to give values higher than0
to thez-index
Here is working jsFiddle example.
css:
html:
Note: Used overlay div for deactivate controls and you can use whatever content on your video, like in jsFiddle example.
Source: Video as background on a website playing on command