I need to visible this .inner
elm, But it's not working. z-index
is not working here as expected. But when I remove the .parent
elm to position: absolute/ static then it's visible. Is it normal or I have some code problem.
[Note] The .inner
elm should be inside of the .parent
elm and .parent, .child
elm should have the same z-index. Example:
body{
margin: 0
}
.inner{
position: absolute;
right: 0;
top: 50px;
width: 300px;
height: 40px;
background-color: #f1f1f1;
border: 1px solid #d1d5da;
z-index: 1001;
}
.parent, .child{
z-index: 1000;
}
.parent{
position: fixed;
width: 100%;
height: 60px;
background-color: #fff;
border-bottom: 1px solid #ddd;
}
.child{
position: fixed;
top: 61px;
width: 100%;
height: 30px;
background-color: #fff;
border-bottom: 1px solid #ddd;
}
<div class="parent">
<div class="inner" draggable="true">
</div>
</div>
<div class="child"></div>