<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表单元素</title>
<style>
label {
font-weight: bold;
font-size: 20px;
}
.register-button {
background-color: #008eff;
border: 0;
color: white;
height: 50px;
width: 100%;
border-radius: 5px;
}
input {
height: 30px;
vertical-align: middle;
/* 改变盒子大小计算方式的属性 */
box-sizing: border-box;
}
button {
height: 30px;
vertical-align: middle;
}
.code-box {
font-size: 0;
}
.code-box input {
font-size: 14px;
}
</style>
</head>
<body>
<form>
<table>
<tr>
<td>
<label>用户名</label>
</td>
<td>
<input type="text" placeholder="请设置用户名">
</td>
</tr>
<tr>
<td>
<label>性 别</label>
</td>
<td>
<input type="radio" name="sex" checked>男
<input type="radio" name="sex">女
</td>
</tr>
<tr>
<td>
<label>手机号</label>
</td>
<td>
<input type="text" placeholder="可用于登录和找回密码">
</td>
</tr>
<tr>
<td>
<label>密 码</label>
</td>
<td>
<input type="password" placeholder="请设置登录密码">
</td>
</tr>
<tr>
<td>
<label>验证码</label>
</td>
<td class="code-box">
<input type="text" placeholder="请输入"> <button>获取短信验证码</button>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="checkbox">
阅读并接受
<a href="#">百度用户协议</a>
及
<a href="#">百度隐私权保护声明</a>
</td>
</tr>
<tr>
<!-- 跨列 -->
<td colspan="2">
<button class="register-button"> 注册 </button>
</td>
</tr>
</table>
</form>
</body>
</html>
图例: