Create a Personal Website: Showcase Your Life and Hobbies
<!DOCTYPE html>
<html>
<head>
<title>My Personal Website</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
<pre><code> header {
background-color: #333;
color: white;
padding: 20px;
text-align: center;
}
nav {
background-color: #f2f2f2;
padding: 10px;
text-align: center;
}
nav a {
text-decoration: none;
color: #333;
padding: 10px;
}
nav a:hover {
background-color: #333;
color: white;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.home {
background-image: url('home.jpg');
background-size: cover;
height: 500px;
}
.about {
padding: 20px;
}
.study {
padding: 20px;
}
.hobbies {
padding: 20px;
}
.contact {
padding: 20px;
}
form {
margin-top: 20px;
}
form label {
display: block;
margin-bottom: 10px;
}
form input,
form textarea {
width: 100%;
padding: 10px;
margin-bottom: 20px;
}
form button {
padding: 10px 20px;
background-color: #333;
color: white;
border: none;
cursor: pointer;
}
form button:hover {
background-color: #555;
}
footer {
background-color: #333;
color: white;
padding: 20px;
text-align: center;
}
</style>
</code></pre>
</head>
<body>
<header>
<h1>Welcome to My Personal Website</h1>
</header>
<pre><code><nav>
<a href="index.html">Home</a>
<a href="about.html">About Me</a>
<a href="study.html">Study</a>
<a href="hobbies.html">Hobbies</a>
<a href="contact.html">Contact Me</a>
</nav>
<div class="container">
<div class="home">
<h2>Welcome to My Home Page</h2>
<p>This is a creative page about me and my interests.</p>
</div>
<div class="about">
<h2>About Me</h2>
<p>I was born in the beautiful city of XYZ. Here are some pictures of the city:</p>
<img src="city1.jpg" alt="City 1">
<img src="city2.jpg" alt="City 2">
</div>
<div class="study">
<h2>Study</h2>
<p>I have studied at XYZ University. Here are some pictures of my university:</p>
<img src="university1.jpg" alt="University 1">
<img src="university2.jpg" alt="University 2">
</div>
<div class="hobbies">
<h2>Hobbies</h2>
<p>These are some of my hobbies:</p>
<img src="hobby1.jpg" alt="Hobby 1">
<img src="hobby2.jpg" alt="Hobby 2">
</div>
<div class="contact">
<h2>Contact Me</h2>
<p>Feel free to contact me with any questions or comments:</p>
<form>
<label for="name">Name:</label>
<input type="text" id="name" required>
<label for="email">Email:</label>
<input type="email" id="email" required>
<label for="message">Message:</label>
<textarea id="message" required></textarea>
<button type="submit">Send</button>
</form>
</div>
</div>
<footer>
<p>&copy; 2021 My Personal Website. All rights reserved.</p>
</footer>
</code></pre>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/o4qC 著作权归作者所有。请勿转载和采集!