<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Form</title>
<style>
form {
width: 300px;
align-content: center;
}
fieldset {
width: 300px;
align-content: center;
}
input:disabled {
background-color: #fff;
border: none;
}
input:required {
background-color: rgb(250, 131, 131);
}
</style>
</head>
<body>
<form action="#" method="GET" id="form1"></form>
<fieldset>
<legend>用户注册</legend>
<div class="">
<label for="email">邮箱</label>
<input
type="text"
name="email"
id="email"
required
placeholder="请输入邮箱"
form="form1"
/>
</div>
<div class="">
<label for="passwd">密码</label>
<input
type="password"
name="passwd"
id="passwd"
required
placeholder="不少于6位"
form="form1"
/>
</div>
<div class="">
<label for="savepwd">保存密码</label>
<input type="checkbox" name="savepwd" id="savepwd" form="form1" />
</div>
<div class="">
<label for="age">生日</label>
<input type="date" name="birthday" id="" max="2020-08-02" />
</div>
<div class="">
<label for="aihao">爱好</label>
<input type="text" name="aihao" id="aihao" list="datalist1" />
<datalist id="datalist1">
<option value="php">php</option>
<option value="js">js</option>
<option value="html">html</option>
<option value="css">css</option>
</datalist>
</div>
<div class="">
<label for="gender">性别</label>
<select name="gender" id="gender">
<option value="male">男</option>
<option value="female">女</option>
<option value="other">保密</option>
</select>
</div>
<div class="">
<input type="submit" value="注册" form="form1" />
</div>
<div class="">
<label for="warning">警告</label>
<input
type="text"
name=""
id="warning"
disabled
placeholder="一天内只允许登陆三次"
/>
</div>
</fieldset>
</body>
</html>