Can you explain the style you want in a bit more detail? ( try using AI for translation if you have problem in describing it in english )
only part I understand right now is that you want a setting portion of div has black color and other half is transparent which can be achieved as follows
<body style="background-color: pink;">
<div class="main-div" style="display: flex;width: 324px; height:40px;border:2px solid red; position: relative;">
<p style="position: absolute; left: 0; width: 100%; color:white; font-size: 20px;">This is some random text for testing</p>
<div class="black-div" style="width: 50%; background-color: black">
</div>
<div class="transparent-div" style="width: 50%; background-color:pink;">
</div>
</div>
</body>
Pay main attention to display: flex, position:relative, position: absolute.