html+css网页旅游主题首页模板
时间: 2023-09-13 08:10:45 浏览: 42
以下是一个简单的HTML和CSS旅游主题首页模板,供您参考:
```
<!DOCTYPE html>
<html>
<head>
<title>旅游主题首页</title>
<meta charset="UTF-8">
<link rel="stylesheet" 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>
<section class="banner">
<h2>欢迎来到旅游主题</h2>
<p>发现世界上最美丽的地方</p>
<a href="#" class="button">立即预订</a>
</section>
<section class="destination">
<h2>热门目的地</h2>
<ul>
<li>
<img src="destination1.jpg" alt="目的地1">
<h3>目的地1</h3>
<p>描述目的地1的信息</p>
</li>
<li>
<img src="destination2.jpg" alt="目的地2">
<h3>目的地2</h3>
<p>描述目的地2的信息</p>
</li>
<li>
<img src="destination3.jpg" alt="目的地3">
<h3>目的地3</h3>
<p>描述目的地3的信息</p>
</li>
</ul>
</section>
<footer>
<p>版权所有 © 2021 旅游主题</p>
</footer>
</body>
</html>
```
同时,在同一目录下创建一个名为 `style.css` 的CSS文件,添加以下样式:
```
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
nav li {
margin-right: 20px;
}
nav li a {
color: #fff;
text-decoration: none;
}
.banner {
background-image: url(banner.jpg);
background-size: cover;
background-position: center;
height: 500px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.banner h2 {
font-size: 48px;
margin: 0;
}
.banner p {
font-size: 24px;
margin: 20px 0;
}
.button {
background-color: #fff;
color: #333;
padding: 10px 20px;
border-radius: 20px;
text-decoration: none;
}
.destination {
padding: 50px;
}
.destination h2 {
text-align: center;
margin-bottom: 50px;
}
.destination li {
list-style: none;
display: inline-block;
margin-right: 50px;
}
.destination li img {
width: 300px;
height: 200px;
object-fit: cover;
}
.destination li h3 {
font-size: 24px;
margin: 20px 0;
}
.destination li p {
font-size: 16px;
}
footer {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
```
这是一个简单的模板,您可以根据自己的需要进行修改和添加。希望对您有帮助!