0
我的网站存在问题,它是z-index类型的作品,但它没有,我没有找到符合我在互联网上的需求的答案。z-index不适用于HTML5视频
.Mwrapper
{
z-index: 2;
position: fixed;
bottom: 0%;
margin-top: 120em;
}
.Msliding-background
{
z-index: 2;
background-color: red;
}
.Mhider
{
z-index: 2;
height: 100%;
background: linear-gradient(to top, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0.2), rgba(0,0,0,1));
}
.Mvid
{
z-index: -2;
position: relative;
margin-top: 25em;
text-align: center;
}
.Mvid video
{
position: relative;
z-index: -1;
height: 720px;
width: 1280px;
}
.Mvideo
{
bottom: 724px;
left: 120px;
position: relative;
z-index: 0;
height: 725px;
width: 1280px;
background: radial-gradient(rgba(0,0,0,0), rgba(0,0,0,0.6), rgba(0,0,0,1), rgba(0,0,0,1), rgba(0,0,0,1));
}
<div id="Mfog" class="Mwrapper"><div class="Msliding-background"><div class="Mhider"></div> </div></div>
<nav class="Mvid">
<video id="video">
<source src="demo.mp4" type="video/mp4">
</video>
<div class="Mvideo" onclick="audioPause()"></div>
</nav>
它工作在Mvideo出现上述MVID视频,但Mwrapper不会出现上述MVID感。
所有帮助表示赞赏:)
提示:'z-index'必须位于'relative/absolute'或'fixed'元素中,且不能为负数。 :-) – Alexis
z-index可以是负值,这是完全可以接受的:) –