Growing Page Shells
Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 1 of 55.
A short archive page can use a three-row grid with a header, main region and footer. With a 640px minimum height, a 48px header and a 32px footer, the flexible middle row receives 560px when its content is short.
<main class="grid min-h-screen grid-rows-[auto_1fr_auto]">
<header class="h-12">Archive</header>
<section>Recent notes</section>
<footer class="h-8">Help</footer>
</main>The pattern min-h-screen requests at least one viewport height. The 1fr middle row absorbs spare space, while auto rows size to their content. Unlike a fixed viewport height, a minimum allows the whole page to grow when the main content needs more room.
Challenge
MediumBuild a full-page workshop shell. Use a grid with content-sized header and footer rows and a flexible middle row. The shell must be at least the viewport height, but remain free to grow. Preserve the supplied 80px header and 40px footer.
Preserve the supplied content, semantic elements and IDs. Edit the requested utility classes. Press Run preview after edits, then Check/Run code to grade the result. Supplied JavaScript is read-only.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<main id="shell" class="grid grid-rows-[auto_auto_auto]"><header class="h-20">Workshop desk</header><section id="content">Upcoming workshops</section><footer class="h-10">Contact the desk</footer></main>
</body></html>
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Responsive UI Patterns
1Page Shells
Growing Page ShellsFlexible Content RailsBounded Scroll RegionsFull-Bleed RegionsRecap: Page Shells4Form Layouts
Responsive Field GroupsFocused Field GroupsSelectable Form OptionsNative Validation CuesRecap: Form Layouts2Navigation Patterns
Wrapping NavigationCurrent Page CuesNative Menu DisclosuresKeyboard Skip LinksRecap: Navigation5Data Tables
Scrollable Data TablesPredictable Table ColumnsRow State PresentationSticky Table HeadersRecap: Data Tables8Interactive Panels
Expanded Control CuesChoice Card StatesFocus-Aware Help PanelsContent-Aware Empty StatesRecap: Interactive Panels11Project: Event Portal
Portal ShellSession Browser