暗色html模板,暗色个人主页网站模板
时间: 2023-09-11 20:04:52 浏览: 113
以下是一个暗色的 HTML 模板,可供你参考:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dark Website Template</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<h1>Dark Website Template</h1>
</header>
<main>
<section>
<h2>About Us</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in elit at magna condimentum malesuada. Nulla id ante enim. Fusce malesuada, nibh vel posuere malesuada, libero dui bibendum felis, eu convallis mauris felis sed lectus. Morbi eget lacus risus. Sed viverra urna ut nisl interdum, id bibendum est efficitur. Praesent quis ex erat. Donec fringilla, nunc a aliquet sagittis, diam sapien accumsan tellus, id bibendum magna sapien eu risus. Vestibulum elementum lacus sit amet magna pellentesque, sed posuere lacus efficitur.</p>
</section>
<section>
<h2>Services</h2>
<ul>
<li>Web Design</li>
<li>Graphic Design</li>
<li>Branding</li>
<li>Marketing</li>
</ul>
</section>
<section>
<h2>Portfolio</h2>
<ul>
<li><img src="image1.jpg" alt="Image 1"></li>
<li><img src="image2.jpg" alt="Image 2"></li>
<li><img src="image3.jpg" alt="Image 3"></li>
<li><img src="image4.jpg" alt="Image 4"></li>
</ul>
</section>
<section>
<h2>Contact Us</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<label for="message">Message:</label><br>
<textarea id="message" name="message" rows="4" cols="50"></textarea><br><br>
<input type="submit" value="Send">
</form>
</section>
</main>
<footer>
<p>© 2021 Dark Website Template</p>
</footer>
</body>
</html>
```
同时,你还需要一个样式表 `style.css`,用于设置页面的样式:
```css
body {
background-color: #222;
color: #fff;
font-family: Arial, sans-serif;
font-size: 16px;
}
header {
background-color: #333;
padding: 20px;
text-align: center;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
}
nav ul li {
display: inline-block;
}
nav ul li a {
color: #fff;
display: block;
padding: 10px;
text-decoration: none;
}
nav ul li a:hover {
background-color: #444;
}
main {
padding: 20px;
}
section {
margin-bottom: 40px;
}
h2 {
font-size: 24px;
margin-bottom: 20px;
}
ul {
list-style: none;
margin: 0;
padding: 0;
}
li {
margin-bottom: 10px;
}
img {
max-width: 100%;
}
form label {
display: block;
margin-bottom: 10px;
}
form input,
form textarea {
border: none;
border-radius: 5px;
padding: 10px;
}
form input[type="submit"] {
background-color: #333;
color: #fff;
cursor: pointer;
padding: 10px 20px;
}
```
你可以将图片文件命名为 `image1.jpg`、`image2.jpg`、`image3.jpg` 和 `image4.jpg` 并与 HTML 文件和样式表文件放在同一个目录下。
阅读全文