I am trying to position text on top of this responsive mockup image. The text is supposed to go in the white search bar, but since it is responsive I am having trouble lining it up and having it scale accordingly.
How can I get ensure the text is always centered in the white rectangle search bar and scale with the image responsively?
p{
z-index: 100;
position: absolute;
color: black;
font-size: 24px;
font-weight: bold;
left: 200px;
top: 300px;
}
<script src="https://cdn.tailwindcss.com"></script>
<div class="flex flex-wrap w-full justify-center content-center px-12">
<div class="flex flex-wrap lg:items-center min-h-screen">
<div class="flex flex-col w-full lg:w-1/2 justify-center">
<img src="https://i.imgur.com/sb5Jz5I.png" class="object-contain max-h-full">
<p id="text">Dynamic text!</p>
</div>
<div class="flex flex-wrap w-full lg:w-1/2 justify-center">
<h3 class="text-3xl">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</h3>
</div>
</div>