用html,css,js写一个外卖平台的注册登录页面
时间: 2024-03-01 14:56:21 浏览: 32
好的,我可以给你提供一个简单的示例代码,你可以根据自己的需求进行更改和完善。
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>外卖平台注册登录页面</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="login-container">
<div class="register">
<h2>注册</h2>
<form>
<input type="text" placeholder="用户名">
<input type="password" placeholder="密码">
<input type="password" placeholder="确认密码">
<input type="email" placeholder="邮箱">
<button type="submit">注册</button>
</form>
</div>
<div class="login">
<h2>登录</h2>
<form>
<input type="text" placeholder="用户名">
<input type="password" placeholder="密码">
<button type="submit">登录</button>
</form>
</div>
</div>
</body>
</html>
```
CSS代码:
```css
body {
margin: 0;
padding: 0;
background-color: #f5f5f5;
font-family: Arial, sans-serif;
}
.login-container {
width: 500px;
margin: 100px auto;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 20px rgba(0, 0, 0, .3);
overflow: hidden;
}
.register, .login {
float: left;
width: 50%;
padding: 30px;
box-sizing: border-box;
}
h2 {
margin: 0 0 20px;
font-size: 24px;
color: #333;
}
form {
display: flex;
flex-direction: column;
}
input[type="text"], input[type="password"], input[type="email"] {
margin-bottom: 20px;
padding: 10px;
border: none;
border-radius: 3px;
box-shadow: 0 0 3px rgba(0, 0, 0, .1);
}
button[type="submit"] {
padding: 10px;
background-color: #3498db;
color: #fff;
border: none;
border-radius: 3px;
box-shadow: 0 0 3px rgba(0, 0, 0, .1);
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #2980b9;
}
```
JS代码:
```javascript
// 无需JS代码
```
以上代码可以实现一个简单的外卖平台注册登录页面,你可以根据需要进行修改和美化。