美食注册页面HTML与css
时间: 2023-11-04 21:08:28 浏览: 31
以下是一个简单的美食注册页面的 HTML 和 CSS 代码示例:
HTML 代码:
```
<!DOCTYPE html>
<html>
<head>
<title>美食注册</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<h1>美食注册</h1>
<form>
<label for="username">用户名</label>
<input type="text" id="username" name="username" required>
<label for="email">邮箱</label>
<input type="email" id="email" name="email" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<label for="confirm-password">确认密码</label>
<input type="password" id="confirm-password" name="confirm-password" required>
<button type="submit">注册</button>
</form>
</div>
</body>
</html>
```
CSS 代码:
```
.container {
max-width: 500px;
margin: 0 auto;
text-align: center;
padding: 20px;
border: 1px solid #ccc;
border-radius: 10px;
background-color: #f2f2f2;
}
h1 {
font-size: 36px;
margin-bottom: 20px;
}
form label {
display: block;
font-size: 18px;
margin-top: 20px;
text-align: left;
}
form input {
display: block;
width: 100%;
padding: 10px;
font-size: 16px;
border-radius: 5px;
border: 1px solid #ccc;
margin-top: 10px;
box-sizing: border-box;
}
button[type="submit"] {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
font-size: 18px;
border: none;
border-radius: 5px;
margin-top: 20px;
cursor: pointer;
}
```
这个注册页面包含一个标题、一个表单和一个提交按钮。表单包括用户名、邮箱、密码和确认密码字段。CSS 样式设置了容器的宽度、边框、内边距和背景颜色,以及标题、表单标签、输入框和提交按钮的样式。