<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表单验证</title>
</head>
<body>
<div style="display: flex">
<form action="#" method="post" style="margin: 100px auto">
<label for="username"> 用户名:</label>
<input type="text" name="username" id="username"> <br>
<label for="password">密码: </label>
<input type="password" name="password" id="password"> <br>
性别:
<input type="radio" name="gender" value="1" id="male" ><label for="male">男</label>
<input type="radio" name="gender" value="2" id="female" ><label for="female">女</label>
<br>
爱好:
<input type="checkbox" name="hobby" value="1">旅游
<input type="checkbox" name="hobby" value="2">电影
<input type="checkbox" name="hobby" value="3">游戏
<br>
头像:
<input type="file"><br>
城市:
<select name="city">
<option>北京</option>
<option>上海</option>
<option>深圳</option>
</select>
<br>
<div>个人描述:</div>
<textarea cols="20" rows="5" name="desc"></textarea>
<br>
<br>
<input type="submit" value="免费注册">
<input type="reset" vallue="重置">
<input type="button" value="一个按钮">
</form>
</div>
一个简单的表单,进行了简单的美化