From learner to builder

You've learned HTML structure, CSS styling, forms, layouts, and animations. Now it's time to bring it all together in a real-world project: a professional portfolio website.

A portfolio is more than decoration — it's your digital resume. It shows employers, clients, and collaborators what you can build. By the end of this lesson, you'll have a complete, responsive, interactive portfolio that you can customize and deploy.

This is it:
This is the final lesson of the HTML & CSS track. You're about to build something you can actually use.

What you'll build:

  • Hero section — Your name, title, and bio with a profile image
  • Projects grid — 3+ projects with images, hover overlays, and links
  • Skills section — Styled skill tags or progress bars
  • Contact form — Fully styled with validation feedback
  • Dark/Light mode toggle — CSS variables + JavaScript
  • Smooth scrolling — Navigation that feels native
  • Responsive design — Perfect on mobile, tablet, desktop

CSS variables for theming

Professional portfolios need consistent, maintainable styling. CSS variables (custom properties) let you define colors, spacing, and fonts once and reuse them everywhere. This makes it easy to switch themes or update your brand.

portfolio.css CSS variables for light and dark modes

By using variables, you can toggle dark mode with a single class: body.dark-mode. All colors update automatically. Try building your portfolio with at least 3 core colors and reusing them consistently.

Project card hover overlay effect

One of the most satisfying interactions on a portfolio is a project card that reveals more on hover. The effect: image stays in place, an overlay slides in with opacity change, showing the project title, description, and a link button.

portfolio.css Hover overlay with smooth transition

The magic: position: relative on the parent card contains the overlay. The overlay is position: absolute, covering the entire card. On hover, we change opacity and transform: scale for a smooth, polished effect. No javascript needed.

Build editor: About section and projects grid

Edit the code below to create your portfolio's hero and projects. Start with a simple about section (heading, name, bio, profile image placeholder), then a 3-column projects grid with hover overlays.

✏️ Try It Yourself — About & Projects
Preview

Try this: Change the name and bio. Add your own project titles. Try changing the gradient colors or the number of columns on desktop vs mobile.

Styled contact form with validation

A contact form is essential for a portfolio. It should be easy to use and visually match your brand. Use semantic HTML (<form>, <label>, <input>) paired with CSS for styling and JavaScript for validation feedback.

contact-form.html Accessible form with styled inputs and validation states

Key points: Use <label> elements linked to inputs with for and id. Style the :focus state to show interactivity. Hide error messages by default, show them only when a field is invalid. Test on mobile — inputs should be large enough to tap easily.

Build editor: Skills, contact form, and footer

Now add skills and a contact form. Use styled tags or progress bars for skills, then a validated contact form below. End with a multi-column footer with social links.

✏️ Try It Yourself — Skills & Contact
Preview

Next steps: Update the skill tags with your own. Customize the contact form — add or remove fields as needed. Make the footer reflect your brand and include your actual social media links.

Implementing dark/light mode

A dark mode toggle is a professional touch that improves usability. Users can choose the theme they prefer. Implement it with CSS variables (defined above) and a JavaScript button that toggles a class on <body>.

dark-mode.js Toggle dark mode with localStorage persistence

The magic: CSS variables automatically update when body.dark-mode is added. localStorage remembers the user's choice across page reloads. Put the toggle button in the navigation bar for easy access.

Bonus: Add a media query for system preference: @media (prefers-color-scheme: dark) { ... } automatically respects the user's OS settings.

Making it responsive

A professional portfolio works on mobile, tablet, and desktop. Test your site at multiple breakpoints and adjust layouts with media queries.

📱
Mobile First
Design for small screens first, then expand

Start with single-column layouts on mobile. Use max-width: 100% and flexible padding. Only use media queries to adjust at larger breakpoints (768px, 1024px). This forces you to prioritize content.

Key responsive patterns:

  • Projects grid: grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) — auto-wraps on smaller screens
  • Hero text: font-size: clamp(20px, 5vw, 48px) — scales smoothly with viewport
  • Navigation: Fixed on mobile (hamburger menu), horizontal on desktop
  • Contact form: Full width on mobile, constrained to 500px on desktop
  • Footer: Single column on mobile, multi-column on desktop
Pro tip:
Use Chrome DevTools (F12) to test at various screen sizes. Test actual devices too — they feel different.
Capstone Challenge: Build Your Real Portfolio

Task: Create a complete portfolio website and publish it. Include:

  • Your name and title in the hero section (with a profile image or placeholder)
  • At least 3 of your best projects with links (real projects, school work, or fictional)
  • A list of your skills
  • A styled, working contact form
  • Smooth scroll navigation
  • CSS variables for consistent theming
  • Dark/light mode toggle
  • At least one custom CSS animation (fade-in, slide, bounce, etc.)
  • Fully responsive (mobile, tablet, desktop)

Bonus: Deploy it to Netlify or GitHub Pages (both free).

Hint: Start with the editors above as templates. Copy one and expand it with all sections. Use semantic HTML (header, main, footer). Test on mobile with Chrome DevTools. Deploy early and often — you'll catch bugs faster.

Capstone recap: What you've built

  • CSS variables for maintainable, themeable styling
  • Hover overlays with smooth transitions
  • Semantic forms with accessible labels and validation
  • Dark mode toggle with localStorage persistence
  • Responsive grid layouts that adapt to any screen size
  • Professional design patterns used on real-world portfolios
  • A complete, deployable website you can show employers and clients

Test your knowledge

Question 1 of 5
How do you create a project card hover overlay that shows on top of an image?
Question 2 of 5
What CSS property enables smooth scrolling when clicking navigation links?
Question 3 of 5
How do you create skill progress bars?
Question 4 of 5
What makes a contact form accessible?
Question 5 of 5
How do you implement a dark mode toggle that persists across page reloads?
0
/5
Fantastic! You're ready to build.
Africa & India's Best AI Academy
🤖 AI-first 🎓 Placement Assistance

You just built a portfolio.
Imagine what comes next.

Join the Best AI Programs — three 5-month courses, fully online, with placement assistance. Week 1 is free.

Explore our AI-era courses →