It is not possible to directly subtract one element from another to achieve this effect; a workaround is required. Imagine the white strip as three individual elements placed side by side. The outer ones are filled with white, while the center remains transparent. These three elements are contained within a wrapper with a white border to create the illusion of white edges. You can see this effect in action in the example provided below.
img {
width: 100%;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.row {
display: flex;
flex-direction: row;
width: 100%;
height: 100px;
border: 5px solid white;
}
.row .col {
display: inline-block;
height: 100%;
background-color: white;
width: 100%;
}
.row .col.m {
background-color: transparent;
width: 500px;
}
.row .col span {
color: white;
text-align: center;
}
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSfz6VkKDw0b3AacQg2PhSq8BpHf1z8Ngg-iYt_1Qqu5cR6Q3_Z&usqp=CAU">
<div class="center row">
<div class="l col"></div>
<div class="m col">
<span class="center"> Welcome back, <br> user1! </span>
</div>
<div class="r col"></div>
</div>