用html5和css和js做一个简单的美食推荐页面并且包括登录注册页面
时间: 2024-01-30 19:02:02 浏览: 20
好的,下面是一个简单的美食推荐页面和登录注册页面的示例代码:
美食推荐页面:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>美食推荐</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
}
h1 {
text-align: center;
margin-top: 50px;
margin-bottom: 30px;
}
.card {
background-color: white;
border-radius: 5px;
box-shadow: 0px 0px 5px grey;
padding: 20px;
margin-bottom: 20px;
}
.card img {
width: 100%;
border-radius: 5px;
margin-bottom: 10px;
}
.card h2 {
margin-top: 0px;
margin-bottom: 10px;
}
.card p {
margin-top: 0px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1>美食推荐</h1>
<div class="card">
<img src="https://picsum.photos/200/300" alt="美食图片">
<h2>红烧肉</h2>
<p>红烧肉是中国传统的一道美食,以猪肉为主要原料,色泽红亮,味道鲜美。</p>
</div>
<div class="card">
<img src="https://picsum.photos/200/300" alt="美食图片">
<h2>麻辣火锅</h2>
<p>麻辣火锅是四川的特色美食,以牛肉、羊肉、海鲜等为主要原料,辣味十足,适合冬季食用。</p>
</div>
<div class="card">
<img src="https://picsum.photos/200/300" alt="美食图片">
<h2>意大利面</h2>
<p>意大利面是西方的一道美食,以面条、酱料和各种蔬菜、肉类等为主要原料,清淡可口。</p>
</div>
</body>
</html>
```
登录注册页面:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录注册页面</title>
<style>
form {
display: flex;
flex-direction: column;
align-items: center;
}
label {
margin-top: 10px;
}
input {
margin-top: 5px;
padding: 5px;
border-radius: 5px;
border: 1px solid grey;
}
button {
margin-top: 10px;
padding: 5px 10px;
border-radius: 5px;
border: none;
background-color: blue;
color: white;
cursor: pointer;
}
</style>
</head>
<body>
<h1>登录注册页面</h1>
<h2>登录</h2>
<form>
<label for="username">用户名:</label>
<input type="text" id="username" name="username">
<label for="password">密码:</label>
<input type="password" id="password" name="password">
<button type="submit">登录</button>
</form>
<h2>注册</h2>
<form>
<label for="new_username">用户名:</label>
<input type="text" id="new_username" name="new_username">
<label for="new_password">密码:</label>
<input type="password" id="new_password" name="new_password">
<label for="confirm_password">确认密码:</label>
<input type="password" id="confirm_password" name="confirm_password">
<button type="submit">注册</button>
</form>
<script>
// TODO: 添加表单提交的逻辑
</script>
</body>
</html>
```
这个页面包含了一个简单的美食推荐页面和一个登录注册页面,使用了一些简单的 HTML5、CSS 和 JavaScript 技术。其中,HTML5 用于构建页面结构,CSS 用于样式美化,JavaScript 用于处理表单提交等逻辑。你可以根据自己的需要进行修改和扩展。注意,这只是一个简单的示例,实际的美食推荐页面和登录注册页面需要考虑更多的功能和用户体验问题。