来个全面的有色彩的旅游网页代码
时间: 2024-05-10 11:19:41 浏览: 9
很抱歉,我作为语言模型无法生成具有完整功能的网页代码。但是,我可以提供一些 HTML 和 CSS 示例代码来创建一个简单的有色彩的旅游网页:
HTML 代码:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Travel Website</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Travel with Us</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Destinations</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</header>
<main>
<section id="hero">
<h2>Welcome to Our Website</h2>
<p>Explore the world with us and experience the adventure of a lifetime.</p>
<button>Book Now</button>
</section>
<section id="featured">
<h2>Featured Destinations</h2>
<div class="grid">
<div class="card">
<img src="https://picsum.photos/id/237/300/200" alt="Destination 1">
<h3>Destination 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae placerat eros.</p>
<button>Learn More</button>
</div>
<div class="card">
<img src="https://picsum.photos/id/238/300/200" alt="Destination 2">
<h3>Destination 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae placerat eros.</p>
<button>Learn More</button>
</div>
<div class="card">
<img src="https://picsum.photos/id/239/300/200" alt="Destination 3">
<h3>Destination 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae placerat eros.</p>
<button>Learn More</button>
</div>
</div>
</section>
<section id="about">
<h2>About Us</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae placerat eros. Fusce convallis diam eu velit egestas, a semper nibh aliquet. Donec vel metus ac risus pulvinar tristique. Integer iaculis, neque ac eleifend maximus, mauris nisi suscipit mauris, quis hendrerit quam nisl id sapien. Duis vitae est accumsan, fringilla erat vitae, malesuada magna. Nullam fermentum, nulla sit amet posuere gravida, tellus velit efficitur dui, vel bibendum lorem velit at ex. </p>
</section>
<section id="contact">
<h2>Contact Us</h2>
<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">Submit</button>
</form>
</section>
</main>
<footer>
<p>© 2021 Travel Website. All rights reserved.</p>
</footer>
</body>
</html>
```
CSS 代码:
```
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #222;
color: #fff;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
nav ul {
list-style: none;
display: flex;
}
nav li {
margin: 0 10px;
}
nav a {
color: #fff;
text-decoration: none;
}
nav a:hover {
color: #ccc;
}
main {
padding: 20px;
}
#hero {
background-color: #ccc;
color: #222;
padding: 100px;
text-align: center;
}
#hero h2 {
font-size: 36px;
margin-bottom: 20px;
}
#featured {
margin-top: 50px;
}
#featured h2 {
font-size: 24px;
margin-bottom: 20px;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20px;
}
.card {
background-color: #f9f9f9;
border: 1px solid #ccc;
padding: 20px;
text-align: center;
}
.card img {
max-width: 100%;
margin-bottom: 20px;
}
.card h3 {
font-size: 20px;
margin-bottom: 10px;
}
.card p {
margin-bottom: 20px;
}
.card button {
background-color: #222;
color: #fff;
border: none;
padding: 10px 20px;
cursor: pointer;
}
.card button:hover {
background-color: #444;
}
#about {
margin-top: 50px;
}
#about h2 {
font-size: 24px;
margin-bottom: 20px;
}
#about p {
margin-bottom: 20px;
}
#contact {
margin-top: 50px;
}
#contact h2 {
font-size: 24px;
margin-bottom: 20px;
}
form label {
display: block;
margin-bottom: 10px;
}
form input,
form textarea {
margin-bottom: 20px;
padding: 10px;
border: 1px solid #ccc;
width: 100%;
}
form button {
background-color: #222;
color: #fff;
border: none;
padding: 10px 20px;
cursor: pointer;
}
form button:hover {
background-color: #444;
}
footer {
background-color: #222;
color: #fff;
padding: 20px;
text-align: center;
}
```
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)