HTML Project
HTML Project
-----------------------------------------------------------------------------------------------------------------------------------
Objective
Create a personal portfolio web page with the following sections:
Project Structure
Folder Structure
Portfolio/
│
├── index.html # Main HTML file
├── styles.css # External CSS file
└── images/ # Folder for images
1. index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Portfolio</title>
<link rel="stylesheet" href="styles.css">
</head>
<body <!-- Header Section -->
<header>
<nav>
<ul class="nav-links">
<li><a href="#about">About Me</a></li>
<li><a href="#projects">Projects</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="message">Message:</label>
<textarea id="message" name="message" rows="4" required></textarea>
2. styles.css
/* General Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f9;
color: #333;
}
/* Header Styles */
header {
background-color: #4CAF50;
padding: 10px 20px;
}
.nav-links {
display: flex;
justify-content: flex-end;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links li {
margin-left: 20px;
}
.nav-links a {
color: white;
text-decoration: none;
}
/* Hero Section */
.hero {
text-align: center;
padding: 50px 20px;
background-color: #333;
color: white;
}
/* Section Styles */
section {
padding: 40px 20px;
max-width: 900px;
margin: 0 auto;
}
h2 {
color: #4CAF50;
text-align: center;
margin-bottom: 20px;
}
.project {
margin-bottom: 20px;
border: 1px solid #ccc;
padding: 10px;
background-color: white;
}
/* Form Styles */
form {
max-width: 500px;
margin: 0 auto;
display: flex;
flex-direction: column;
}
label {
margin-top: 10px;
}
button {
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
margin-top: 20px;
}
button:hover {
background-color: #45a049;
}
/* Footer */
footer {
text-align: center;
padding: 20px;
background-color: #4CAF50;
color: white;
margin-top: 20px;
}
3. Images
Place any images you need for your projects inside the images/ folder. Update the src attribute of
<img> tags in your index.html as needed.
Example:
<img src="images/profile.jpg" alt="Profile Picture">