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.
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.
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.
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 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.
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.
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>.
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.
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
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
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 →