This Chat is read-only. Login to resume chatting.
<template>
<div class="h-screen flex flex-col">
<!-- HEADER -->
<header class="bg-blue-600 text-white p-4">
<div class="max-w-4xl mx-auto flex justify-between items-center">
<div class="font-bold">MyApp</div>
<nav class="flex space-x-4">
<a>Home</a><a>About</a><a>Contact</a>
</nav>
</div>
</header>
<!-- MAIN: Takes remaining space, scrolls if needed -->
<main class="flex-1 min-h-0 overflow-y-auto">
<!-- Top area: expands to fill available space -->
<section class="flex-1 flex flex-col gap-6 p-6 min-h-0">
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 1</div>
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 2</div>
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 3</div>
</section>
<!-- Bottom element: sticks to bottom of MAIN -->
<div class="p-4 bg-gray-300 sticky bottom-0">
This element is at the bottom (of the main area, under the header)
</div>
</main>
<!-- Extra content below the fold (visible only when scrolled) -->
<div class="p-6 bg-gray-100">
<h2 class="text-lg font-semibold mb-2">More content below</h2>
<p>This text is below the fold. The whole page scrolls, including the bottom element above.</p>
</div>
</div>
</template><template>
<div class="h-screen flex flex-col">
<!-- HEADER -->
<header class="bg-blue-600 text-white p-4">
<div class="max-w-4xl mx-auto flex justify-between items-center">
<div class="font-bold">MyApp</div>
<nav class="flex space-x-4">
<a>Home</a><a>About</a><a>Contact</a>
</nav>
</div>
</header>
<!-- MAIN: Takes remaining space, scrolls if needed -->
<main class="flex-1 min-h-0 overflow-y-auto bg-yellow-50">
<!-- Top area: expands to fill available space -->
<section class="flex-1 flex flex-col gap-6 p-6 min-h-0">
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 1</div>
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 2</div>
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 3</div>
</section>
<!-- Bottom element: sticks to bottom of MAIN -->
<div class="p-4 bg-gray-300">
This element is at the bottom (of the main area, under the header)
</div>
</main>
</div>
<!-- Extra content below the fold (visible only when scrolled) -->
<div class="p-6 bg-gray-100">
<h2 class="text-lg font-semibold mb-2">More content below</h2>
<p>This text is below the fold. The whole page scrolls, including the bottom element above.</p>
</div>
</template><template>
<div class="h-screen flex flex-col">
<!-- HEADER -->
<header class="bg-blue-600 text-white p-4">
<div class="max-w-4xl mx-auto flex justify-between items-center">
<div class="font-bold">MyApp</div>
<nav class="flex space-x-4">
<a>Home</a>
<a>About</a>
<a>Contact</a>
</nav>
</div>
</header>
<!-- MAIN: Takes remaining space, scrolls if needed -->
<main class="flex-1 overflow-y-auto min-h-0">
<!-- Top area: expands to fill available space -->
<section class="flex flex-col gap-6 p-6 h-full">
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 1</div>
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 2</div>
<div class="flex-1 bg-white rounded-lg shadow p-4">Item 3</div>
</section>
<!-- Bottom element: sticks to bottom of MAIN -->
<div class="p-4 bg-gray-300">
This element is at the bottom (of the main area, under the header)
</div>
</main>
</div>
<!-- Extra content below the fold (visible only when scrolled) -->
<div class="p-6 bg-gray-100">
<h2 class="text-lg font-semibold mb-2">More content below</h2>
<p>This text is below the fold. The whole page scrolls, including the bottom element above.</p>
</div>
</template>