Lab 05: Responsive Design
Overview
Step 1: Mobile-First Methodology
/* ❌ Desktop-first: start big, scale down */
.nav { display: flex; gap: 2rem; }
@media (max-width: 768px) { .nav { flex-direction: column; } }
/* ✓ Mobile-first: start small, scale up */
.nav {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
@media (min-width: 640px) { /* sm */
.nav { flex-direction: row; gap: 1rem; }
}
@media (min-width: 1024px) { /* lg */
.nav { gap: 2rem; }
}Step 2: Fluid Typography with clamp()
Step 3: Container Queries
Step 4: Modern Viewport Units
Step 5: Intrinsic Sizing
Step 6: Responsive Images
Step 7: Complete Responsive Layout
Step 8: Capstone — clamp() Type Scale Calculator
Summary
Feature
Syntax
Purpose
Last updated
