Certainly! Here's a basic structure for a modern portfolio website for a programmer. This example uses HTML, CSS, and a bit of JavaScript for interactivity. You can expand upon this foundation by adding more sections, projects, and styles.
Folder Structure
code Copy code
portfolio/
├── index.html
├── styles.css
└── script.js
index.html
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>John Doe's Portfolio</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<nav>
<div class="logo">John Doe</div>
<ul class="nav-links">
<li><a href="#about">About</a></li>
<li><a href="#projects">Projects</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<section id="hero">
<h1>Hi, I'm John Doe</h1>
<p>A passionate programmer</p>
</section>
<section id="about">
<h2>About Me</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vel leo sit amet erat ullamcorper vehicula.</p>
</section>
<section id="projects">
<h2>Projects</h2>
<div class="project">
<h3>Project 1</h3>
<p>Description of Project 1.</p>
</div>
<div class="project">
<h3>Project 2</h3>
<p>Description of Project 2.</p>
</div>
</section>
<section id="contact">
<h2>Contact Me</h2>
<form id="contact-form">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" required></textarea>
<button type="submit">Send</button>
</form>
</section>
<footer>
<p>© 2023 John Doe</p>
</footer>
<script src="script.js"></script>
</body>
</html>
styles.css
css Copy code
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
}
header {
background: #333;
color: #fff;
padding: 1rem 0;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
}
.nav-links {
list-style: none;
display: flex;
gap: 1rem;
}
.nav-links a {
color: #fff;
text-decoration: none;
font-weight: bold;
}
#hero {
background: url('hero-bg.jpg') no-repeat center center/cover;
color: #fff;
text-align: center;
padding: 4rem 1rem;
}
section {
padding: 2rem 1rem;
max-width: 1200px;
margin: 0 auto;
}
h1, h2, h3 {
color: #333;
}
#projects .project {
margin-bottom: 2rem;
}
form {
display: flex;
flex-direction: column;
}
form label {
margin-bottom: 0.5rem;
font-weight: bold;
}
form input, form textarea {
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
}
form button {
padding: 0.5rem;
background: #333;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
footer {
background: #333;
color: #fff;
text-align: center;
padding: 1rem 0;
}
script.js
javascript Copy code
document.getElementById('contact-form').addEventListener('submit', function(event) {
event.preventDefault();
alert('Thank you for your message!');
});
Additional Tips
Images : Replace 'hero-bg.jpg' with an actual image path or URL.
More Projects : Add more project descriptions and links to your projects.
Styling : Use modern CSS frameworks like Tailwind CSS or Bootstrap for quicker styling.
Interactivity : Add more JavaScript for enhanced user interactions, like smooth scrolling or modal windows.
This basic structure should give you a good starting point for building a modern portfolio website.