JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div class="box"></div>
</div>
CSS
.container {
width: 500px;
height: 500px;
background: blue;
padding-top: 100px;
}
.box {
margin: auto;
width:277px;
height: 200px;
background-color:#FCFBDF;
position: relative;
}
.box:before {
content:"";
position:absolute;
top:0;
bottom:0;
left:0;
right:0;
opacity:0.5;
border-top:40px solid red;
margin-top: -40px
}