html外卖网页代码
时间: 2023-12-25 20:29:57 浏览: 47
以下是一个简单的HTML外卖网页代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>外卖网页</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
text-align: center;
}
.menu-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.menu-item img {
width: 100px;
height: 100px;
object-fit: cover;
margin-right: 10px;
}
.menu-item .item-info {
flex-grow: 1;
}
.menu-item .item-info h3 {
margin: 0;
}
.menu-item .item-info p {
margin: 0;
}
</style>
</head>
<body>
<h1>外卖菜单</h1>
<div class="menu-item">
<img src="food1.jpg" alt="Food 1">
<div class="item-info">
<h3>菜品1</h3>
<p>描述1</p>
<p>价格:$10</p>
</div>
<button>加入购物车</button>
</div>
<div class="menu-item">
<img src="food2.jpg" alt="Food 2">
<div class="item-info">
<h3>菜品2</h3>
<p>描述2</p>
<p>价格:$15</p>
</div>
<button>加入购物车</button>
</div>
<div class="menu-item">
<img src="food3.jpg" alt="Food 3">
<div class="item-info">
<h3>菜品3</h3>
<p>描述3</p>
<p>价格:$12</p>
</div>
<button>加入购物车</button>
</div>
</body>
</html>
```
这个示例展示了一个简单的外卖网页,包含了菜品的图片、名称、描述和价格,并且每个菜品都有一个加入购物车的按钮。