I don't understand why my absolutely positioned element appears after my child_static
div. I always thought that absolutely positioned elements are taken out of the flow. So why doesn't child_absolute
cover the child_static
div?
.parent {
position: relative;
}
.child_static {
height: 20px;
background: blue;
}
.child_absolute {
position: absolute;
height: 20px;
width: 100%;
background: green;
}
<div class='parent'>
<div class='child_static'></div>
<div class='child_absolute'></div>
</div>