<!DOCTYPE html>
<html>
<head>
<title>用户注册表单</title>
<style>
form {
width: 400px;
margin: 0 auto;
font-family: Arial, sans-serif;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"],
input[type="password"],
textarea,
select {
width: 200px;
padding: 5px;
margin-bottom: 10px;
}
input[type="checkbox"],
input[type="radio"] {
margin-right: 5px;
}
.checkbox-group {
margin-bottom: 10px;
}
.flex-container {
display: flex;
flex-direction: column;
}
.flex-container label,
.flex-container input,
.flex-container select {
margin-bottom: 10px;
}
.flex-container .checkbox-group {
flex-direction: row;
align-items: center;
}
input[type="submit"],
input[type="reset"] {
padding: 10px 20px;
background-color: #4CAF50;
color: #fff;
border: none;
margin-top: 10px;
cursor: pointer;
}
input[type="submit"]:hover,
input[type="reset"]:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<form action="/submit" method="post" class="flex-container">
<label for="UserName">用户名:</label>
<input type="text" id="UserName" name="UserName" maxlength="20" pattern=".{15,}" required>
<label for="UserPass">密码:</label>
<input type="password" id="UserPass" name="UserPass" maxlength="20" pattern=".{15,}" required>
<div class="checkbox-group">
<label for="sex">性别:</label>
<input type="radio" id="sex-male" name="sex" value="男" checked>
<label for="sex-male">男</label>
<input type="radio" id="sex-female" name="sex" value="女">
<label for="sex-female">女</label>
</div>
<div class="checkbox-group">
<label for="like">爱好:</label>
<input type="checkbox" id="like-writing" name="like[]" value="写作">
<label for="like-writing">写作</label>
<input type="checkbox" id="like-music" name="like[]" value="听音乐">
<label for="like-music">听音乐</label>
<input type="checkbox" id="like-sports" name="like[]" value="体育">
<label for="like-sports">体育</label>
</div>
<label for="province">省份:</label>
<select id="province" name="province">
<option value="shaanxi" selected>陕西省</option>
<option value="shanx">山西省</option>
</select>
<label for="intro">自我介绍:</label>
<textarea id="intro" name="intro" rows="5" cols="25">这个家伙什么也没留下</textarea>
<input type="submit" id="send" value="提交">
<input type="reset" id="reset" value="重置">
</form>
</body>
</html>
html表单联系 注册表的实现
最新推荐文章于 2024-06-06 10:41:44 发布