I have a parent wrapper with position:relative
and 2 child div inside, 1 child is static
and the is absolute
. For some reason, the absolute
child keeps covering static one even with z-index
. How can I force static div on top?
I want the static
div
content to determine the height of the parent div
so I don't want to change its position.
The absolute
div
is for a background image that should appear at the bottom of parent div
.
.full-wrapper {
width: 710px;
margin: 0 auto;
position: relative;
}
.timeline-sum-wrapper {
padding: 10px;
clear: both;
background-color: gray;
z-index: 99999;
height: 200px;
}
.soccer-field {
position: absolute;
height: 200px;
bottom: 0px;
width: 98%;
right: 1%;
background-color: red;
height: 150px;
}
<div class="full-wrapper">
<div class="timeline-sum-wrapper">
</div>
<div class="soccer-field">
</div>
</div>