Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody..
I have a small problem. I have a video in my page. And I had a div with position fixed on that page with z-index:1000. The div z-index not working at the position of the video because the video is coming top of the div. So can anyone please tell me whether there is any style for div to rectify this problem??

Thanks in advance.
Posted
Updated 29-Oct-12 22:21pm
v3

1 solution

It sounds like it's a browser or a css issue. This code below works and opens the video and puts a div over the bottom right 1/4 of it.

XML
<!DOCTYPE html>
<html>
<head>
<style>
#over
{
    display: block;
    position: absolute;
    left: 240px;
    top: 180px;
    border: solid 1px black;
    width: 480px;
    height: 360px;
    background-color: white;
    z-index: 2;
}
</style>
</head>
<body>
    <video style='width: 480px; height: 360px; z-index: 1' src='vid/03.mp4' type='video/mp4'>
        Fallback text
    </video>
    <div id='over'>Some sample content</div>
</body>
</html>
 
Share this answer
 
Comments
Venkat_C6 30-Oct-12 4:37am    
Thank you for your response.
But Im not using video tag. Im using object with embed tag. For this its not working.
enhzflep 30-Oct-12 4:48am    
No worries.
Are you using an swf object? If so, is there any chance you edit your question to include the html you use to include the object?
Venkat_C6 30-Oct-12 5:57am    
Hi.. Sorry for the late.. Iam using youtube link..

<object width="650" height="340"><param name="movie" value="http://www.youtube.com/v/r9AnNEgTWkQ&hl=en_US&fs=1&autoplay=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/r9AnNEgTWkQ&hl=en_US&fs=1&autoplay=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="650" height="340"></embed></object>
enhzflep 30-Oct-12 7:50am    
Hehe, no worries. Just tried it with the <object> tag - works fine for me using Chrome 22.0.1229.94 m & Opera 12.02. It fails in IE9. It works fine in the default browser on my Android (2.3) phone.

I've got a vague memory of hearing that you can get youtube in two 'formats' - a pre-hmtl5 and a html5 version. I wonder if the difference is flash/native <video> elements.
Just looked, it seems so. Still, I don't know if this would be suitable for your situation.

HTML5 & Youtube
Venkat_C6 30-Oct-12 8:03am    
If we keep wmode="opaque" for embed tag means it works fine. But the main problem is if I do like that means we have so many pages in our project to update. So iam checking for the solution with div properties. Why because the div is in the master page. So that we can update in a single page.
Anyway thank you so much for your response..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900