When my current code displays a container with a header and content div
, the header does not extend to match the sibling width when the sibling overflows. I initially thought using flex-1
would solve this issue, but it didn't work. Is there another solution for this problem?
<div class="flex w-[500px] flex-col overflow-x-auto bg-red-300">
<h1 class="flex-1 bg-orange-300">Header</h1>
<div class="h-96 w-[750px] bg-green-300">Content</div>
</div>