写一段旅游网web代码
时间: 2024-01-20 12:04:43 浏览: 131
很抱歉,我不能直接为您编写完整的代码,因为这需要根据您的具体需求和技术栈进行定制。但是,我可以提供一个通用的旅游网站的网页代码框架,您可以根据您的需要进行修改和改进。
HTML 代码:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>Travel Website</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Destinations</a></li>
<li><a href="#">Tours</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="hero">
<h1>Welcome to our travel website</h1>
<p>Explore the world with us</p>
<a href="#" class="button">Get Started</a>
</section>
<section id="destinations">
<h2>Popular Destinations</h2>
<ul>
<li>
<img src="destination1.jpg" alt="Destination 1" />
<h3>Destination 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a href="#" class="button">Explore</a>
</li>
<li>
<img src="destination2.jpg" alt="Destination 2" />
<h3>Destination 2</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a href="#" class="button">Explore</a>
</li>
<li>
<img src="destination3.jpg" alt="Destination 3" />
<h3>Destination 3</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<a href="#" class="button">Explore</a>
</li>
</ul>
</section>
</main>
<footer>
<p>© 2021 Travel Website. All rights reserved.</p>
</footer>
</body>
</html>
```
CSS 代码:
```
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
header {
background-color: #fff;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
position: fixed;
width: 100%;
z-index: 1;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
background-color: #fff;
}
nav li {
float: left;
}
nav li a {
display: block;
padding: 20px;
text-decoration: none;
font-weight: bold;
color: #555;
}
nav li a:hover,
nav li a.active {
color: #e67e22;
}
main {
margin-top: 80px;
}
#hero {
background-image: url('hero.jpg');
background-size: cover;
text-align: center;
color: #fff;
padding: 100px 0;
}
#hero h1 {
font-size: 50px;
margin: 0;
}
#hero p {
font-size: 24px;
margin-bottom: 30px;
}
.button {
display: inline-block;
background-color: #e67e22;
color: #fff;
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
}
#destinations {
padding: 50px;
text-align: center;
}
#destinations h2 {
font-size: 36px;
margin-bottom: 30px;
}
#destinations ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
}
#destinations ul li {
margin: 0 20px;
text-align: left;
}
#destinations ul li img {
width: 100%;
height: auto;
border-radius: 5px;
margin-bottom: 10px;
}
#destinations ul li h3 {
font-size: 24px;
margin: 0;
}
#destinations ul li p {
font-size: 18px;
margin-bottom: 20px;
}
#destinations ul li .button {
margin-top: 10px;
}
footer {
background-color: #f2f2f2;
padding: 20px;
text-align: center;
font-size: 14px;
color: #555;
}
```
这是一个简单的响应式的旅游网站的代码框架。您可以根据需要进行修改和改进。
阅读全文