Im following a tutorial to recreate iPhone interface with Tailwind-CSS. When I removed absolute from the div that is supposed to make the camera line on top, the div disappear. Why does this happen?
The following is my code that was tweaked a bit from the original (I tried to make the camera line with a div, not two div)
<body>
<div class="px-10 min-h-screen bg-purple-50 flex justify-end items-center">
<div class="relative h-[712px] w-[350px] bg-black rounded-[60px] shadow-xl overflow-hidden border-[14px] border-black">
<img src="img/wallpaper.webp" class="absolute inset-0 h-full w-full object-cover" alt="">
<div class="h-6 w-40 top-0 absolute inset-x-0 bg-black mx-auto rounded-b-3xl">
</div>
</div>
</div>
</body>
This is the original div
<div class="absolute top-0 inset-x-0">
<div class="mx-auto bg-black h-6 w-40 rounded-b-3xl"></div>
</div>