Lesson 2 of 8
Styling & Responsive Design
Apply CSS styling to your portfolio - modern layout with CSS Grid, responsive design with media queries, smooth animations, and a polished professional look. This topic bridges HTML structure with visual presentation.
Portfolio Styling Strategy
- Mobile-first approach - Start with mobile styles, add desktop styles with @media (min-width: 768px)
- CSS Grid for layout - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) for responsive project cards
- CSS custom properties - :root { --primary: #E44D26; } for consistent theming across the site
- Smooth scrolling - html { scroll-behavior: smooth; } for polished anchor link navigation
- Typography scale - Use clamp() for responsive font sizes: font-size: clamp(1rem, 2.5vw, 1.5rem)
- Hover animations - transform: translateY(-4px) on project cards for professional interactivity
Try It Yourself: Mini Portfolio
Quick Quiz: Portfolio Design
Warning
Never skip the viewport meta tag <meta name='viewport' content='width=device-width, initial-scale=1'>. Without it, mobile browsers render at desktop width (usually 980px) and shrink everything to fit, making text unreadable and buttons too small to tap.
Responsive design adapts HTML layouts smoothly across all screen sizes
Practice Task: SEO Head Audit
- Open any page you've built and check the <head> section for completeness
- Ensure it has: <meta charset='UTF-8'>, viewport meta, <title> (under 60 chars), and <meta name='description'> (under 160 chars)
- Add Open Graph tags: og:title, og:description, og:image, and og:url
- Add a canonical URL tag: <link rel='canonical' href='...'>
- Run Google's Rich Results Test to check your structured data (if any)
Key Takeaways
- Apply CSS styling to your portfolio - modern layout with CSS Grid, responsive design with media queries, smooth animations, and a polished professional look.
- Mobile-first approach - Start with mobile styles, add desktop styles with @media (min-width: 768px)
- CSS Grid for layout - grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) for responsive project cards
- CSS custom properties - :root { --primary: #E44D26; } for consistent theming across the site
Finished this lesson?