<!
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Personal Website</title>
<style>
/* CSS Styling */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
color: #333;
header {
background: #4CAF50;
color: white;
padding: 10px 20px;
header h1 {
margin: 0;
nav ul {
list-style: none;
padding: 0;
display: flex;
gap: 15px;
nav ul li {
display: inline;
nav ul li a {
color: white;
text-decoration: none;
.section {
padding: 20px;
margin: 20px auto;
max-width: 800px;
background: #f9f9f9;
border-radius: 8px;
.project-list {
display: flex;
gap: 20px;
}
.project {
flex: 1;
padding: 10px;
background: #e3f2fd;
border-radius: 8px;
footer {
text-align: center;
padding: 10px;
background: #333;
color: white;
form label, form input, form textarea, form button {
display: block;
width: 100%;
margin-bottom: 10px;
form input, form textarea {
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
form button {
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
form button:hover {
background-color: #45a049;
#response-message {
margin-top: 10px;
font-weight: bold;
</style>
</head>
<body>
<header>
<div class="container">
<h1>Welcome to My Website</h1>
<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>
</div>
</header>
<main>
<section id="about" class="section">
<h2>About Me</h2>
<p>Hello! I'm [Your Name], a [Your Profession] passionate about [Your
Interests].</p>
</section>
<section id="projects" class="section">
<h2>Projects</h2>
<div class="project-list">
<div class="project">
<h3>Project 1</h3>
<p>Description of your project.</p>
</div>
<div class="project">
<h3>Project 2</h3>
<p>Description of your project.</p>
</div>
</div>
</section>
<section id="contact" class="section">
<h2>Contact</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>
<p id="response-message"></p>
</section>
</main>
<footer>
<p>© 2024 [Your Name]. All rights reserved.</p>
</footer>
<script>
// JavaScript for form interactivity
document.getElementById('contact-form').addEventListener('submit',
function (e) {
e.preventDefault();
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const message = document.getElementById('message').value;
if (name && email && message) {
document.getElementById('response-message').textContent =
`Thank you, ${name}! Your message has been sent.`;
document.getElementById('response-message').style.color = 'green';
this.reset();
} else {
document.getElementById('response-message').textContent =
'Please fill out all fields.';
document.getElementById('response-message').style.color = 'red';
});
</script>
</body>
</html>