Creating a personal portfolio site is one of the most rewarding first projects for anyone dipping their toes into web development. Not only does it give you a place to showcase your work, it also forces you to practice core skills like semantic HTML, modern CSS layout techniques, and responsive design. In this guide we’ll walk you through every step required to build a clean, mobile‑friendly portfolio using only HTML5 and CSS3. No JavaScript, no frameworks—just the fundamentals that every web developer should master.
What You'll Need
- A text editor (VS Code, Sublime Text, or even Notepad++)
- Basic knowledge of HTML tags and CSS properties
- A modern browser for testing (Chrome, Firefox, or Edge)
- Command‑line access (optional but helpful for creating folders)
- An Unsplash account if you want to download royalty‑free images
Step 1: Set Up Your Project Folder
Open your terminal (or Command Prompt) and navigate to where you keep your projects. Run the following commands to create a clean folder structure:
mkdir portfolio-site
cd portfolio-site
mkdir assets
mkdir assets/images
mkdir assets/css
Inside portfolio-site create two files: index.html and assets/css/style.css. This simple hierarchy keeps HTML, CSS, and images nicely separated, making future updates a breeze.
Step 2: Write Semantic HTML5 Markup
Open index.html in your editor and paste the skeleton below. Notice the use of semantic elements like <header>, <nav>, <section>, and <footer>. Search engines love this structure, and it improves accessibility.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Name – Portfolio</title>
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<header class="site-header">
<h1>Your Name</h1>
<p class="tagline">Frontend Developer & Designer</p>
</header>
<nav class="site-nav">
<ul>
<li><a href="#about">About</a></li>
<li><a href="#projects">Projects</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<main>
<section id="about" class="about-section">
<h2>About Me</h2>
<p>Write a short bio that highlights your skills, experience, and what makes you unique.</p>
</section>
<section id="projects" class="projects-section">
<h2>Projects</h2>
<div class="project-grid">
<article class="project-card">
<img src="assets/images/project1.jpg" alt="Project 1 screenshot">
<h3>Project Title</h3>
<p>A brief description of what the project does and the technologies used.</p>
<a href="#" class="btn">View Details</a>
</article>
</div>
</section>
<section id="contact" class="contact-section">
<h2>Contact</h2>
<p>Provide an email address or a simple contact form (we’ll keep it static for now).</p>
</section>
</main>
<footer class="site-footer">
<p>© 2026 Your Name. All rights reserved.</p>
</footer>
</body>
</html>
Save the file. At this point you can open it in a browser and you’ll see a plain, unstyled page with all the sections in place.
Step 3: Add a Mobile‑First CSS Reset
Open assets/css/style.css and start with a lightweight reset. A reset removes the browser’s default margins and paddings, giving you a predictable baseline.
/* 1. Basic Reset – mobile first */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body {
font-family: 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: #333;
background-color: #fafafa;
}
Notice the use of box-sizing: border-box. This tiny line prevents the dreaded “width + padding > 100%” issue that trips many beginners.
Step 4: Build the Layout with Flexbox and Grid
Now we’ll style the navigation, the hero header, and the project grid. Flexbox works great for one‑dimensional layouts (like the top navigation), while CSS Grid shines for two‑dimensional arrangements (like the project cards).
/* Header & Navigation */
.site-header {
text-align: center;
padding: 2rem 1rem;
background: linear-gradient(135deg, #4a90e2, #9013fe);
color: #fff;
}
.site-nav ul {
display: flex;
justify-content: center;
gap: 1.5rem;
list-style: none;
background-color: #fff;
padding: 0.5rem 0;
}
.site-nav a {
text-decoration: none;
color: #4a90e2;
font-weight: 600;
}
/* Project Grid – CSS Grid */
.project-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 1.5rem;
padding: 2rem 1rem;
}
.project-card {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
display: flex;
flex-direction: column;
}
.project-card img {
width: 100%;
height: auto;
}
.project-card h3 {
margin: 0.75rem 1rem 0.5rem;
font-size: 1.2rem;
color: #222;
}
.project-card p {
flex-grow: 1;
margin: 0 1rem 1rem;
font-size: 0.95rem;
color: #555;
}
.project-card .btn {
display: block;
text-align: center;
background: #4a90e2;
color: #fff;
padding: 0.5rem 0;
text-decoration: none;
font-weight: 600;
}
Because we used repeat(auto-fit, minmax(260px, 1fr)), the grid automatically reflows the cards to fit any screen width. This is the heart of a responsive layout.
Step 5: Make It Truly Responsive with Media Queries
Even with a fluid grid, you’ll want to tweak typography, spacing, and navigation layout for larger screens. Add the following at the bottom of style.css:
/* 2. Breakpoints – start small, then grow */
@media (min-width: 600px) {
.site-header { padding: 3rem 2rem; }
.site-nav ul { gap: 2rem; }
}
@media (min-width: 900px) {
.site-header h1 { font-size: 2.5rem; }
.site-nav { position: sticky; top: 0; background: #fff; }
.about-section, .contact-section { max-width: 800px; margin: 0 auto; padding: 2rem 1rem; }
}
Notice how the @media rules are written mobile‑first (they start at a minimum width). This approach guarantees that the base styles work on phones, then enhance for tablets and desktops.
Step 6: Polish the Footer and Add a Simple Contact Link
Finish the visual polish by styling the footer and adding a mailto link. Append the following CSS:
.site-footer {
text-align: center;
padding: 1rem;
background: #222;
color: #ddd;
font-size: 0.9rem;
}
.contact-section a {
color: #4a90e2;
text-decoration: underline;
}
Now edit the contact section in index.html to include a real email address:
<p>Feel free to <a href="mailto:[email protected]">email me</a> for collaborations or just to say hi!</p>
Refresh the browser. You should see a fully styled, responsive portfolio that looks good on phones, tablets, and desktops. Congratulations—your first live site is ready!
Common Mistakes to Avoid
Even seasoned developers slip up on simple projects. Here are the pitfalls that most beginners encounter and how to sidestep them:
- Skipping the viewport meta tag. Without
<meta name="viewport" content="width=device-width, initial-scale=1.0">the page will render zoomed out on mobile devices. - Hard‑coding widths. Using fixed pixel values (e.g.,
width: 960px) breaks fluid layouts. Prefer percentages,max-width, orfrunits. - Forgetting
box-sizing: border-box. This leads to unexpected overflow when adding padding or borders. - Over‑nesting selectors. Deep selector chains increase specificity and make future overrides painful. Keep CSS flat and modular.
- Neglecting accessibility. Always provide
alttext for images and use semantic HTML tags.
Tips and Tricks
Boost your workflow with these quick wins:
- Use VS Code’s Emmet abbreviations (
! + Tab) to scaffold the HTML5 boilerplate instantly. - Leverage the browser’s DevTools “Toggle device toolbar” to test breakpoints without leaving the page.
- Store reusable color variables in a
:rootselector so you can change the theme in one place. - Compress images with an online tool (TinyPNG or ImageOptim) before placing them in
assets/imagesto improve load times. - Consider adding a
robots.txtfile and a simplesitemap.xmlonce you publish the site.
Frequently Asked Questions
Do I need JavaScript for a responsive portfolio?
No. All the layout adjustments in this guide are handled with CSS media queries and modern layout modules. JavaScript is only required for advanced interactions like sliders or dynamic content loading.
Can I host this site for free?
Absolutely. GitHub Pages, Netlify, and Vercel all offer free static‑site hosting. Push your portfolio-site repository, point the domain to the provider, and your site will be live in minutes.
How do I make the project cards link to actual project pages?
Create a separate HTML file for each project (e.g., project1.html) and replace the placeholder # in the View Details button with the correct filename. Then, optionally, add a rel="noopener" attribute for security if you open links in a new tab.
Conclusion
Building a responsive portfolio with pure HTML5 and CSS3 is an excellent way to cement foundational web‑development skills. By following the steps above—setting up a clean folder, writing semantic markup, applying a mobile‑first stylesheet, and fine‑tuning with media queries—you now have a professional‑looking site that works everywhere. Keep experimenting: swap colors, add subtle animations, or integrate a static site generator later on. The sky’s the limit, and your portfolio is the perfect canvas to showcase every new trick you learn.
Photo by Duskfall Crew on Unsplash




