代码
<h3>用户注册</h3>
<form
action="register,php"
method="POSt"
enctype="application/x-www-form-urlencoded"
target="_blank"
id="test"
>
<fieldset>
<legend>基本信息</legend>
<div class="upload">
<label for="upload">头像:</label>
<input type="file" id="upload" name="user_pic" />
<button type="button">上传</button>
</div>
<div class="username">
<label for="username">用户名:</label>
<input
type="text"
id="username"
value=""
name="username"
placeholder="请输入用户名"
required
/>
</div>
<div class="pwd">
<label for="pwd">密码</label>
<input
type="password"
name="pwd"
id="pwd"
value="123456"
placeholder="请输入密码"
required
/>
<button
type="button"
onclick="this.previousElementSibling.type='text'"
>
显示密码
</button>
</div>
<div class="email">
<label for="email">邮箱:</label>
<input
type="email"
id="email"
name="email"
placeholder="xxx@xx.xxx"
/>
</div>
<div class="sex">
<label for="sex">性别:</label>
<input type="radio" name="sex" value="man" id="man" /><label for="man"
>男</label
>
<input type="radio" name="sex" value="weman" id="weman" /><label
for="weman"
>女</label
>
</div>
<div class="db">
<label for="db">出生日期:</label>
<input
type="date"
id="db"
name="db"
min="1970-01-01"
max="2030-01-01"
/>
</div>
<div class="age">
<label for="age">年龄:</label>
<input
type="number"
id="age"
value="18"
min="18"
max="150"
step="1"
/>
</div>
<div class="hobby">
<label for="">爱好:</label>
<input type="checkbox" name="hobby[]" id="game" value="game" />
<label for="game">游戏</label>
<input type="checkbox" name="hobby[]" id="a" value="a" checked />
<label for="a">编程</label>
<input type="checkbox" name="hobby[]" id="b" value="b" />
<label for="b">电影</label>
<input type="checkbox" name="hobby[]" id="c" value="c" />
<label for="c">旅游</label>
</div>
</fieldset>
</form>
效果展示