Final project: your responsive portfolio website
Bring the whole HTML and CSS course together: build, test and publish a responsive, accessible one-page portfolio with a header, projects grid, skills and contact form, with a rubric and full solution.
🎯 By the end of this project you will be able to:
- Plan and build a complete page with semantic HTML
- Style it with an external stylesheet, variables, Flexbox and Grid
- Make it responsive and accessible, and check it like a professional
Outline
The brief
Every web developer needs a portfolio: a page that says who you are, shows your work and lets people contact you. You will build yours now, using everything from this course. When it is online, it is also proof of your skills for job applications, internships and freelance work.
Your deliverables:
- A folder containing
index.html,styles.cssand animagesfolder. - A page with: a header with your name and a navigation menu; an introduction with a photo or illustration; a Projects section with at least three project cards; a Skills section; a Contact section with a form; and a footer.
- The page passes the HTML validator, works with the keyboard, and has one column on phones and a wider layout from 700px.
Starter materials
Create a new folder called portfolio with an empty index.html and styles.css, and copy in the images folder from the sample images you downloaded in lesson 3 (download them again below if needed).
⬇ Download sample images (ZIP)profile.svg for your introduction and project.svg for project cards. Unzip into your portfolio folder.
portfolio/
├── index.html
├── styles.css
└── images/
├── profile.svg
└── project.svgMilestones
Build in this order. Save and check the page in your browser after every milestone; small steps make problems easy to find.
| # | Milestone | Skills (lesson) |
|---|---|---|
| 1 | Write the full HTML structure, with no CSS yet: head, header with nav, main with four sections, footer | 1 to 5 |
| 2 | Link styles.css; add box-sizing, colour variables, body font and line height, flexible images, focus styles | 6, 7, 9 |
| 3 | Style the header and navigation with Flexbox | 10 |
| 4 | Style the introduction, button, project cards (Grid with auto-fit) and skill tags | 8, 9, 11 |
| 5 | Style the contact form: labels above fields, comfortable padding, a clear button | 5, 8 |
| 6 | Add a min-width: 700px media query for the side-by-side header and introduction | 12 |
| 7 | Test: validator, keyboard, device mode at 360px, contrast and Lighthouse. Fix what you find | 13 |
| 8 | Optional: publish on GitHub Pages and open it on your phone | 13 |
Milestone 1: the HTML
Write your own HTML first. Then compare it with this worked solution. Yours does not need to match line for line; check that it has the same structure and the same accessibility features.
Guided exercise
Write index.html
Build the complete HTML structure, with no CSS yet. It will look plain; that is expected.
- Start with the full page skeleton, including the viewport meta tag, a title, a meta description and the stylesheet link.
- Add a
headerwith your name as a link to#topand anavholding a list of three links. - Add
mainwithid="top"and four sections: an introduction (with your<h1>), Projects, Skills and Contact. Give the last three anidmatching the menu links. - In Projects, add three
articlecards, each with an image, anh3and a paragraph. - In Contact, add a form with labelled name, email and message fields and a submit button.
- Finish with a
footer.
Show the solution
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Asha Kumar | Junior Web Developer in Pune</title>
<meta name="description" content="Portfolio of Asha Kumar, a junior web developer in Pune who builds accessible, responsive websites for small businesses and charities.">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="site-header">
<a class="logo" href="#top">Asha Kumar</a>
<nav aria-label="Main">
<ul>
<li><a href="#projects">Projects</a></li>
<li><a href="#skills">Skills</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main id="top">
<section class="hero">
<img src="images/profile.svg" alt="Illustrated portrait of Asha Kumar" width="400" height="400">
<div>
<h1>Hi, I'm Asha. I build friendly websites.</h1>
<p>I am a junior web developer in Pune. I make accessible, responsive pages for small businesses and charities.</p>
<p><a class="button" href="#contact">Get in touch</a></p>
</div>
</section>
<section id="projects">
<h2>Projects</h2>
<div class="cards">
<article class="card">
<img src="images/project.svg" alt="The Green Leaf Café home page on a laptop" width="600" height="400">
<h3>Green Leaf Café</h3>
<p>A one-page site with the menu, opening hours and a contact form.</p>
</article>
<article class="card">
<img src="images/project.svg" alt="Ravi's cooking blog shown on a laptop" width="600" height="400">
<h3>Cooking blog</h3>
<p>A blog layout with articles, a sidebar of tips and a responsive grid.</p>
</article>
<article class="card">
<img src="images/project.svg" alt="The City Library events page on a laptop" width="600" height="400">
<h3>Library events</h3>
<p>An accessible events list with a timetable and a sign-up form.</p>
</article>
</div>
</section>
<section id="skills">
<h2>Skills</h2>
<ul class="tags">
<li>Semantic HTML</li>
<li>CSS Flexbox and Grid</li>
<li>Responsive design</li>
<li>Accessibility</li>
</ul>
</section>
<section id="contact">
<h2>Contact</h2>
<form class="contact-form" action="https://example.com/contact" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" autocomplete="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" autocomplete="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" required></textarea>
<button type="submit">Send message</button>
</form>
</section>
</main>
<footer class="site-footer">
<p>© 2026 Asha Kumar · Built with HTML and CSS</p>
</footer>
</body>
</html>How to get there: The page has one h1, sections with h2 headings, project titles as h3, landmarks for every region, alt text on every image and a label for every form field. The id values match the menu links so they jump to each section. The form's action is an example address: to receive real messages you would connect a form service or a server, which the JavaScript and full-stack courses cover.
Milestones 2 to 6: the CSS
Style your page milestone by milestone. When you are done, or if you get stuck, compare with this worked solution. Use the preview's Phone (360px) and Laptop (1024px) buttons to see both layouts.
Your turn
Write styles.css
Style the page so it looks good and works from 360px phones to wide laptop screens.
Show the solution
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
--brand: #6d28d9;
--brand-dark: #4c1d95;
--light: #f5f3ff;
--text: #1f2937;
--radius: 0.75rem;
}
body {
margin: 0;
font-family: "Segoe UI", Arial, sans-serif;
line-height: 1.6;
color: var(--text);
}
img {
max-width: 100%;
height: auto;
}
a {
color: var(--brand);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
outline: 3px solid #f59e0b;
outline-offset: 2px;
}
/* Header and navigation */
.site-header {
padding: 1rem;
background-color: var(--brand-dark);
}
.site-header a {
color: white;
}
.logo {
font-size: 1.25rem;
font-weight: 700;
text-decoration: none;
}
.site-header ul {
display: flex;
flex-wrap: wrap;
gap: 1rem;
list-style: none;
margin: 0.5rem 0 0;
padding: 0;
}
/* Page width and sections */
main {
max-width: 60rem;
margin: 0 auto;
padding: 0 1rem;
}
section {
padding: 2.5rem 0;
}
/* Introduction */
.hero {
display: grid;
gap: 1.5rem;
align-items: center;
}
.hero img {
width: 10rem;
border-radius: 50%;
}
.hero h1 {
font-size: 1.75rem;
line-height: 1.2;
margin: 0 0 0.5rem;
}
.button {
display: inline-block;
padding: 0.75rem 1.5rem;
border-radius: var(--radius);
background-color: var(--brand);
color: white;
font-weight: 700;
text-decoration: none;
}
.button:hover {
background-color: var(--brand-dark);
}
/* Project cards */
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
gap: 1.25rem;
}
.card {
padding: 1rem;
border-radius: var(--radius);
background-color: var(--light);
box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
}
.card img {
border-radius: 0.5rem;
}
.card h3 {
margin: 0.75rem 0 0.25rem;
}
/* Skills */
.tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
list-style: none;
padding: 0;
}
.tags li {
padding: 0.25rem 0.875rem;
border-radius: 999px;
background-color: #ede9fe;
color: var(--brand-dark);
}
/* Contact form */
.contact-form {
display: grid;
gap: 0.5rem;
max-width: 32rem;
}
.contact-form input,
.contact-form textarea {
padding: 0.625rem;
border: 2px solid #6b7280;
border-radius: 0.5rem;
font: inherit;
}
.contact-form button {
justify-self: start;
margin-top: 0.75rem;
padding: 0.75rem 1.5rem;
border: 0;
border-radius: var(--radius);
background-color: var(--brand);
color: white;
font: inherit;
font-weight: 700;
cursor: pointer;
}
.site-footer {
padding: 1.5rem 1rem;
text-align: center;
background-color: #f3f4f6;
}
/* Wider screens */
@media (min-width: 700px) {
.site-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.site-header ul {
margin: 0;
}
.hero {
grid-template-columns: 14rem 1fr;
}
.hero img {
width: 100%;
}
.hero h1 {
font-size: 2.5rem;
}
}Show the HTML this CSS styles
<header class="site-header">
<a class="logo" href="#top">Asha Kumar</a>
<nav aria-label="Main">
<ul>
<li><a href="#projects">Projects</a></li>
<li><a href="#skills">Skills</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main id="top">
<section class="hero">
<img src="images/profile.svg" alt="Illustrated portrait of Asha Kumar" width="400" height="400">
<div>
<h1>Hi, I'm Asha. I build friendly websites.</h1>
<p>I am a junior web developer in Pune. I make accessible, responsive pages for small businesses and charities.</p>
<p><a class="button" href="#contact">Get in touch</a></p>
</div>
</section>
<section id="projects">
<h2>Projects</h2>
<div class="cards">
<article class="card">
<img src="images/project.svg" alt="The Green Leaf Café home page on a laptop" width="600" height="400">
<h3>Green Leaf Café</h3>
<p>A one-page site with the menu, opening hours and a contact form.</p>
</article>
<article class="card">
<img src="images/project.svg" alt="Ravi's cooking blog shown on a laptop" width="600" height="400">
<h3>Cooking blog</h3>
<p>A blog layout with articles, a sidebar of tips and a responsive grid.</p>
</article>
<article class="card">
<img src="images/project.svg" alt="The City Library events page on a laptop" width="600" height="400">
<h3>Library events</h3>
<p>An accessible events list with a timetable and a sign-up form.</p>
</article>
</div>
</section>
<section id="skills">
<h2>Skills</h2>
<ul class="tags">
<li>Semantic HTML</li>
<li>CSS Flexbox and Grid</li>
<li>Responsive design</li>
<li>Accessibility</li>
</ul>
</section>
<section id="contact">
<h2>Contact</h2>
<form class="contact-form" action="https://example.com/contact" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" autocomplete="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" autocomplete="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" required></textarea>
<button type="submit">Send message</button>
</form>
</section>
</main>
<footer class="site-footer">
<p>© 2026 Asha Kumar · Built with HTML and CSS</p>
</footer>Browser preview
How to get there: The stylesheet goes from general to specific: reset and variables, then base styles for the body, images, links and focus, then each section in page order, and finally the media query. Phone layout is the default (mobile first). Flexbox handles one-direction lines (navigation, tags); Grid handles the introduction and the card grid, where auto-fit makes the cards responsive without a media query. All colours come from variables, and every text colour has a contrast ratio of at least 4.5:1 with its background.
Milestone 7: test like a professional
| Test | How | Pass when |
|---|---|---|
| HTML is valid | Upload index.html at validator.w3.org | No errors |
| Keyboard works | Press Tab from the top of the page | Every link, field and button is reached in a sensible order, with a visible focus outline |
| Phone layout | Device mode (Ctrl+Shift+M) at 360px wide | One column, no sideways scrolling, text readable without zooming |
| Wide layout | Make the window wider than 700px | Name and menu side by side; photo beside the introduction; cards in columns |
| Menu links | Click each menu link | The page jumps to the right section |
| Form checks | Press Send with empty fields, then with an email missing the @ | The browser stops and explains the problem |
| Contrast and Lighthouse | Lighthouse → Accessibility, Mobile | No contrast failures; fix anything else it reports |
Ideas to go further
Finished? Try one or more of these:
- Add a second page,
projects.html, with more detail about one project, and link to it from its card. - Add a dark footer with links to your GitHub and LinkedIn profiles.
- Use
:hoveron cards to lift them slightly with a biggerbox-shadow. - Replace the sample images with screenshots of your own pages (and update the alt text).
Recap
- You planned a page, wrote its structure in semantic HTML, and only then added CSS.
- You used variables, Flexbox, Grid and a mobile-first media query in one stylesheet.
- You checked validity, keyboard use, contrast and phone layout before calling it done.
- You have a portfolio you can publish and keep improving as you learn more.
Check your understanding
Answer all 4 questions, then check your answers to see an explanation for each one.
1. Why are the menu links written as href="#projects"?
2. Why does the card grid not need a media query?
3. The phone layout is in the normal CSS and the wide layout is inside @media (min-width: 700px). What is this approach called?
4. Lighthouse gives the page 100 for accessibility. What should you still do?
Self-check and complete the course
Tick every rubric item to complete the project.