<div>
is styled flexibly, while <section>
is inserted within it and formatted statically. However, <section>
shows up underneath the lower right corner of the image, rather than at the upper left corner of its flexible parent. I am struggling to comprehend why it fails to disregard its sibling's positioning.
Here is the snippet:
.flex-container {
display: flex;
}
.static-element {
position: static;
}
<div class="flex-container">
<img src="http://placehold.it/270x270" class="img-responsive">
<span class="label label-primary static-element">Overlay</span>
</div>
Reference image for expected output:
https://i.sstatic.net/sfSY7.png
It seems like I need a clearer understanding of how display:flex
and position:static
interact in this scenario. Could someone shed light on why the result shown in the image is not being achieved?