请参考好客山东网写一个元素丰富的html页面。首先,我们需要理解好客山东网的基本特点和风格,以便在创作时能够准确把握其整体风格和主题。据我观察,在好客山东网上,布局 风格多样,包括全屏幕大图、网格相册、环绕文字、左右栏、卡片式、轮播图等;样式比较明亮鲜艳,以蓝色、黄色等亮色为主调,并 融合一些有韵味的活泼元素;动态效果较为丰富,包括滚动、弹窗、弹性动画、缩放、淡入淡出等。排版风格比较整洁、规范、统一 字体以宋体微软雅黑为主,对齐方式居中或靠左;色彩风格采用渐变色、矢量图等,色彩浓郁、视觉冲击力强。 根据以上特点,我们可以通过CSS实现一些基础样式,如背景颜色、字体、边框等,同时使用JS实现一些特效,如动态滑动、延迟加 载、特效展示等。请给出完整的页面代码
时间: 2023-05-25 07:05:02 浏览: 114
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>好客山东网</title>
<style>
body {
background-color: #f2f2f2;
font-family: 微软雅黑, Arial, sans-serif;
font-size: 16px;
color: #333;
}
h1 {
color: #212121;
font-size: 40px;
text-align: center;
}
.navbar {
background-color: #4caf50;
height: 60px;
display: flex;
align-items: center;
padding: 0 20px;
position: fixed;
width: 100%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
z-index: 999;
}
.navbar a {
color: #fff;
text-decoration: none;
margin-right: 30px;
font-size: 20px;
font-weight: bold;
transition: color .3s;
}
.navbar a:hover {
color: #f2f2f2;
}
.banner {
height: 400px;
background-image: url("https://picsum.photos/1200/400");
background-size: cover;
background-position: center;
display: flex;
align-items: center;
justify-content: center;
}
.banner h2 {
color: #fff;
font-size: 60px;
font-weight: bold;
text-align: center;
text-shadow: 2px 2px #212121;
}
.grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 20px;
margin: 50px auto;
max-width: 1200px;
padding: 0 20px;
}
.grid .item {
background-color: #fff;
box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.2);
padding: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
transition: transform .3s;
}
.grid .item:hover {
transform: translateY(-10px);
}
.grid .item img {
width: 100px;
height: 100px;
border-radius: 50%;
margin-bottom: 20px;
object-fit: cover;
}
.grid .item h3 {
font-size: 24px;
color: #212121;
margin-bottom: 10px;
}
.grid .item p {
font-size: 16px;
color: #666;
}
.cta {
background-color: #f44336;
padding: 50px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.cta h2 {
color: #fff;
font-size: 48px;
font-weight: bold;
}
.cta p {
color: #fff;
font-size: 24px;
margin-bottom: 30px;
}
.cta button {
background-color: #fff;
color: #f44336;
padding: 10px 30px;
border: none;
border-radius: 4px;
font-size: 20px;
font-weight: bold;
cursor: pointer;
transition: background-color .3s;
}
.cta button:hover {
background-color: #f2f2f2;
}
.footer {
background-color: #212121;
color: #f2f2f2;
padding: 30px;
text-align: center;
}
.footer p {
margin: 0;
font-size: 16px;
}
</style>
</head>
<body>
<nav class="navbar">
<a href="#">首页</a>
<a href="#">景点介绍</a>
<a href="#">旅游攻略</a>
<a href="#">精品特产</a>
<a href="#">关于我们</a>
</nav>
<header class="banner">
<h2>好客山东网</h2>
</header>
<main>
<section class="grid">
<div class="item">
<img src="https://picsum.photos/200/200" alt="景点一">
<h3>景点一</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ullamcorper ante, nec condimentum sapien pretium eu. Nullam eget porttitor nisi.</p>
</div>
<div class="item">
<img src="https://picsum.photos/200/200" alt="景点二">
<h3>景点二</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ullamcorper ante, nec condimentum sapien pretium eu. Nullam eget porttitor nisi.</p>
</div>
<div class="item">
<img src="https://picsum.photos/200/200" alt="景点三">
<h3>景点三</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ullamcorper ante, nec condimentum sapien pretium eu. Nullam eget porttitor nisi.</p>
</div>
<div class="item">
<img src="https://picsum.photos/200/200" alt="景点四">
<h3>景点四</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ullamcorper ante, nec condimentum sapien pretium eu. Nullam eget porttitor nisi.</p>
</div>
<div class="item">
<img src="https://picsum.photos/200/200" alt="景点五">
<h3>景点五</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ullamcorper ante, nec condimentum sapien pretium eu. Nullam eget porttitor nisi.</p>
</div>
<div class="item">
<img src="https://picsum.photos/200/200" alt="景点六">
<h3>景点六</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras auctor ullamcorper ante, nec condimentum sapien pretium eu. Nullam eget porttitor nisi.</p>
</div>
</section>
<section class="cta">
<h2>订阅我们的邮件</h2>
<p>获取最新的旅游资讯和折扣特惠</p>
<form action="">
<input type="email" placeholder="请输入您的邮箱">
<button type="submit">立即订阅</button>
</form>
</section>
</main>
<footer class="footer">
<p>好客山东网 © 2021</p>
</footer>
</body>
</html>
阅读全文