This box uses opacity
This box has a background color with an alpha channel
<style type="text/css">
.wrapper {
height: 200px;
display: flex;
gap: 20px;
background-image: url(
https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AA1bqNSX.img
);
background-repeat: no-repeat;
background-size: cover;
padding: 20px;
}
.box1 {
background-color: #000;
color: #fff;
opacity: .5;
}
.box2 {
background-color: rgba(0,0,0,.5);
color: #fff;
}
</style>