Html Z索引不起作用(定位和堆叠上下文感知)
我对z-index有问题。我尝试将图像置于iframe中的视频下Html Z索引不起作用(定位和堆叠上下文感知),html,image,css,iframe,z-index,Html,Image,Css,Iframe,Z Index,我对z-index有问题。我尝试将图像置于iframe中的视频下 img { position:relative; } iframe { position:relative; z-index: 2; } 我搜索了答案,只得到了关于位置和堆叠上下文的提示,这在这里不是问题(当然,如果我想对的话)。我想请你帮忙 编辑 包含此img和iframe的html的一部分 <div id="main-menu" class="navbar navbar-default nav
img
{
position:relative;
}
iframe
{
position:relative;
z-index: 2;
}
我搜索了答案,只得到了关于位置和堆叠上下文的提示,这在这里不是问题(当然,如果我想对的话)。我想请你帮忙
编辑
包含此img和iframe的html的一部分
<div id="main-menu" class="navbar navbar-default navbar-fixed-top" role="navigation">
<img src="images/logo/logo_biale_margins320.png" id="logo"/>
</div>
<section id="page-top" class="section-style" data-background-image="images/background/page-top.jpg">
<div class="pattern height-resize">
<div class="container" >
<center><h2 class="section-name">
<span>
SHOVROOM<br/>available today!
</span>
</h2></center>
<h3><center>
Present Anything, Anywhere
</center></h3>
<br/><br/>
<header>
<center>
<iframe id="video"
src="https://www.youtube.com/embed/psraUPSYU28?rel=0" frameborder="0" allowfullscreen>
</iframe>
</center>
</header>
SHOVROOM
今天提供!
在任何地方呈现任何东西
下次,只包括与此问题相关的代码。为了让它们重叠,我做了以下工作
position: absolute;
你给出的z指数似乎有效
你能添加你的
html
吗?完成了,我添加了@zgoodyou html有点混乱,你使用的是像center这样的过时标签。谢谢你的反馈,我还在学习@temaniaftho@TemaniAfif-不真实<代码>z索引适用于定位的任何元素