怀化家乡美食页面的前端代码
时间: 2023-08-30 10:12:34 浏览: 117
前端技术栈-怀化-杨-360001
了解你的需求后,我可以给你提供一个简单的怀化家乡美食页面的前端代码示例,供你参考:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>怀化美食</title>
<style type="text/css">
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.logo {
font-size: 24px;
font-weight: bold;
color: #333;
}
.nav {
display: flex;
align-items: center;
}
.nav li {
list-style: none;
margin-right: 20px;
}
.nav li a {
color: #333;
text-decoration: none;
font-size: 16px;
font-weight: bold;
transition: color 0.2s ease-in-out;
}
.nav li a:hover {
color: #f00;
}
.food-list {
display: flex;
flex-wrap: wrap;
margin: 0 -10px;
}
.food-item {
flex-basis: calc(33.33% - 20px);
margin: 10px;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
transition: transform 0.2s ease-in-out;
}
.food-item:hover {
transform: translateY(-10px);
}
.food-item img {
width: 100%;
height: auto;
display: block;
}
.food-item .name {
padding: 10px;
font-weight: bold;
font-size: 18px;
color: #333;
text-align: center;
}
.food-item .desc {
padding: 10px;
font-size: 14px;
color: #999;
text-align: center;
}
@media (max-width: 768px) {
.food-item {
flex-basis: calc(50% - 20px);
}
}
@media (max-width: 480px) {
.food-item {
flex-basis: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<header class="header">
<div class="logo">怀化美食</div>
<ul class="nav">
<li><a href="#">首页</a></li>
<li><a href="#">推荐美食</a></li>
<li><a href="#">地方特色</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</header>
<div class="food-list">
<div class="food-item">
<img src="https://picsum.photos/300/200" alt="">
<div class="name">怀化米粉</div>
<div class="desc">怀化米粉是怀化地区传统的小吃,以其口感细腻、筋道爽滑而闻名。</div>
</div>
<div class="food-item">
<img src="https://picsum.photos/300/200" alt="">
<div class="name">怀化酸菜鱼</div>
<div class="desc">怀化酸菜鱼是怀化地区的特色美食之一,以其鲜美可口、酸辣开胃而受到广泛喜爱。</div>
</div>
<div class="food-item">
<img src="https://picsum.photos/300/200" alt="">
<div class="name">怀化烤鸭</div>
<div class="desc">怀化烤鸭是怀化地区的传统名菜之一,以其肉质鲜嫩、口感香醇、皮脆肉嫩而著称。</div>
</div>
<!-- 其他美食项... -->
</div>
</div>
</body>
</html>
```
这个示例使用了HTML和CSS实现了一个简单的怀化美食页面,包括了基本的页面布局、美食图片和介绍、响应式设计等。你可以根据自己的需求进行修改和扩展。
阅读全文