Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Picture the central administrative office of a modern school or university. On the wall is a massive digital dashboard:
+-------------------------------------------------------------------------+ | THE SCHOOL ADMIN ERP DASHBOARD BLUEPRINT | | | | +-------------------------------------------------------------------+ | | | [🏫 DPS Admin ERP] [Search] [Principal Profile] | | < Header (60px) | +-------------------------------------------------------------------+ | | | [Sidebar] | [ Metric 1 ] [ Metric 2 ] [ Metric 3 ] | [Calendar] | | | | (240px) |----------------------------------------| (220px) | | | | | | | | | | Classes | Recent Student Admissions | Daily | | | | Exams | Data Table with CSS Grid | Birthdays | | | | Fees | | | | | | Transport | | Bus Alerts | | | +-------------------------------------------------------------------+ | | | Footer Bar | | < Footer (40px) | +-------------------------------------------------------------------+ | +-------------------------------------------------------------------------+
Before CSS Grid, building this kind of multi-column enterprise dashboard required messy nested floats, absolute positioning hacks, and hundreds of lines of brittle JavaScript. With modern CSS Grid, you can construct this robust, scalable application architecture in clean, maintainable code.
In this capstone tutorial for CSS Grid, you will combine grid-template-areas, minmax(), and nested Flexbox to build a complete school management dashboard.
The top-level page wrapper establishes the main structural skeleton:
Inside the main workspace area, we need a 3-card analytics deck. Rather than hardcoding fixed columns, we use the Holy Grail formula so the metric cards wrap smoothly:
On mobile viewports (<= 900px), our 3-column dashboard folds into a streamlined, touch-friendly single column:
| Bad Practice (Don't) | Good Practice (Do) | Why? |
|---|---|---|
| Trying to build the entire dashboard using only Flexbox | Use CSS Grid for the 2D page skeleton, Flexbox for micro-widgets | Grid manages columns and rows simultaneously with zero wrapping glitches. |
Forgetting min-height: 100vh on the full page wrapper | Set min-height: 100vh; on .admin-dashboard | Prevents the page from shrinking awkwardly if content is short. |
Setting hardcoded heights on the main content area | Let row heights be 1fr or auto | Prevents content tables from clipping or spilling out of bounds. |
Hardcoding margin-left: 240px to offset the sidebar | Let grid-template-columns: 240px 1fr handle tracks naturally | Margin offsets are a legacy hack; CSS Grid tracks are mathematically isolated. |
grid-template-columns: 240px 1fr 240px; creates a stable three-column application skeleton.1fr for the central column allows tables and data charts to expand to fit any widescreen monitor.repeat(auto-fit, minmax(200px, 1fr)) inside the workspace for auto-wrapping KPI metric cards.grid-template-areas inside @media stacks the application cleanly without altering the HTML structure.1fr preferred for the main content area between two fixed 240px sidebars?min-height: 100vh; on a dashboard grid container prevent?overflow: hidden; or minmax(0, 1fr) often used on dashboard grid tracks containing wide data tables?Build a complete, production-grade School Administrative Portal:
60px), Left Nav (220px), Main Workspace (1fr), Right Activity Log (240px), and Footer (40px).auto-fit and nested Flexbox.Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Test your understanding of this lesson with 5 questions. Each question has one correct answer.