使用bootstrap框架完成注册页面,用户名,密码,性别,爱好,出生日期,提交
时间: 2024-03-23 16:23:55 浏览: 194
Bootstrap制作登录注册页面(完整项目,已配置)
代码如下:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>注册页面</title>
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-3">
<h1 class="text-center mb-3">注册页面</h1>
<form>
<div class="form-group">
<label for="username">用户名</label>
<input type="text" class="form-control" id="username" placeholder="请输入用户名">
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" class="form-control" id="password" placeholder="请输入密码">
</div>
<div class="form-group">
<label for="gender">性别</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="gender" id="male" value="male">
<label class="form-check-label" for="male">
男
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="gender" id="female" value="female">
<label class="form-check-label" for="female">
女
</label>
</div>
</div>
<div class="form-group">
<label for="hobby">爱好</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="reading" id="reading">
<label class="form-check-label" for="reading">
阅读
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="sports" id="sports">
<label class="form-check-label" for="sports">
运动
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="music" id="music">
<label class="form-check-label" for="music">
音乐
</label>
</div>
</div>
<div class="form-group">
<label for="birthday">出生日期</label>
<input type="date" class="form-control" id="birthday">
</div>
<button type="submit" class="btn btn-primary">提交</button>
</form>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js"></script>
</body>
</html>
```
效果如下:
![注册页面](https://i.loli.net/2021/02/20/hy5rOZbKjJW8zsu.png)
阅读全文