JSFiddle - React, Tailwind, and code Playground
by pmn4
HTML
<div class="container">
<div class="overlay">
Overlay, overlay, overlay
</div>
</div>
<div class="flex-wrapper">
<div class="flexed">
<div class="flex-item">flexed item</div>
<div class="flex-item relative">flexed item, position relative</div>
</div>
</div>
CSS
.container {
position: relative;
}
.overlay {
position: absolute;
top: 0;
left: 50px;
right: 50px;
height: 200px;
background-color: lightblue;
}
.flexed {
display: flex;
}
.flex-item {
flex: 1 1 100%;
height: 100px;
background-color: orange;
margin-top: 50px;
}
.flex-item.relative {
position: relative;
}