html、css旅游页面
时间: 2023-06-20 21:06:35 浏览: 46
好的,以下是一个简单的 HTML 和 CSS 代码示例,可以用于创建一个旅游页面:
HTML 代码:
```
<!DOCTYPE html>
<html>
<head>
<title>旅游页面</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>欢迎来到我们的旅游页面</h1>
<nav>
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">目的地</a></li>
<li><a href="#">行程安排</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</nav>
</header>
<main>
<section class="destination">
<h2>目的地</h2>
<p>我们提供以下目的地:</p>
<ul>
<li>巴黎</li>
<li>伦敦</li>
<li>东京</li>
<li>纽约</li>
</ul>
</section>
<section class="itinerary">
<h2>行程安排</h2>
<p>我们的行程安排如下:</p>
<ul>
<li>第一天:到达目的地,入住酒店</li>
<li>第二天:早餐后参观景点</li>
<li>第三天:自由活动</li>
<li>第四天:离开目的地</li>
</ul>
</section>
<section class="contact">
<h2>联系我们</h2>
<form>
<label for="name">姓名:</label>
<input type="text" id="name" name="name"><br>
<label for="email">邮箱:</label>
<input type="email" id="email" name="email"><br>
<label for="message">留言:</label>
<textarea id="message" name="message"></textarea><br>
<input type="submit" value="提交">
</form>
</section>
</main>
<footer>
<p>版权所有 © 2021</p>
</footer>
</body>
</html>
```
CSS 代码:
```
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
}
nav li {
display: inline-block;
margin-right: 20px;
}
nav li a {
color: #fff;
text-decoration: none;
}
main {
margin: 20px;
}
section {
margin-bottom: 20px;
}
.destination ul {
list-style: disc;
}
.itinerary ul {
list-style: decimal;
}
form label {
display: inline-block;
width: 100px;
}
form input[type="text"],
form input[type="email"],
form textarea {
width: 300px;
margin-bottom: 10px;
}
form textarea {
height: 100px;
}
input[type="submit"] {
background-color: #333;
color: #fff;
border: none;
padding: 10px;
cursor: pointer;
}
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px;
}
```
这个代码示例包含一个页面标题,一个导航菜单,三个主要部分(目的地、行程安排和联系我们),以及一个页脚。你可以根据自己的需求和喜好进行修改和定制。