有视频时,div z-index不起作用 [英] Div z-index not working when there is video

查看:79
本文介绍了有视频时,div z-index不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好..
我有一个小问题.我的页面上有一个视频.我有一个div,其位置固定在该页面上,z-index:1000. div z-index在视频的位置不起作用,因为视频位于div的顶部.那么谁能告诉我div是否有任何样式可以纠正此问题?

在此先感谢.

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.

推荐答案

听起来像是浏览器还是CSS问题.下面的代码可以工作并打开视频,并将div放在视频的右下角1/4处.

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.

<!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>


这篇关于有视频时,div z-index不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆