<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表单_表单提交相关的演练</title>
<style>
/* css reset: 了解 */
/* body, ul {
margin: 0;
padding: 0;
} */
ul {
list-style: none;
}
input, textarea {
outline: none;
}
textarea {
resize: none;
}
/* 真正样式的css */
fieldset {
width: 400px;
}
input, textarea {
outline: none;
}
input:focus, textarea:focus {
border-color: #4791ff;
border-style: solid;
}
</style>
</head>
<body>
<form action="http://www.baidu.com"
method="POST"
enctype="multipart/form-data">
<fieldset>
<legend>必填信息</legend>
<!-- 1.手机输入框 -->
<div>
<label for="phone">手机:</label>
<input type="text"
maxlength="11"
placeholder="请输入您的手机号"
autofocus
name="phone"
tabindex="-1">
</div>
<!-- 2.密码输入框 -->
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password">
</div>
<!-- 3.验证码输入框 -->
<div>
<label for="validate">验证码:</label>
<input type="text" id="validate" name="code">
<!-- 3.1.button实现方式一: button -->
<!-- <button>获取验证码</button> -->
<!-- 3.2.button实现方式二: input-->
<input type="button" value="获取验证码" disabled>
</div>
</fieldset>
<fieldset>
<legend>选填信息</legend>
<!-- 4.照片选择(文件上传) -->
<div>
<label for="photo">照片:</label>
<input type="file" id="photo" name="photo">
</div>
<!-- 5.性别选择 -->
<div>
<span>性别:</span>
<label for="male">男</label>
<input type="radio" name="sex" id="male" value="male" checked>
<label for="female">女</label>
<input type="radio" name="sex" id="female" value="female">
</div>
<!-- 6.爱好选择 -->
<div>
<span>爱好:</span>
<label for="sing">唱歌</label>
<input type="checkbox" name="hobbies" id="sing" value="sing" checked>
<label for="dance">跳舞</label>
<input type="checkbox" name="hobbies" id="dance" value="dance">
<label for="rap">rap</label>
<input type="checkbox" name="hobbies" checked id="rap" value="rap">
<label for="basketball">篮球</label>
<input type="checkbox" name="hobbies" id="basketball" value="basketball">
</div>
<!-- 7.学历 -->
<div>
<span>学历:</span>
<select name="education" id="" multiple>
<option value="0">小学</option>
<option value="1">初中</option>
<option value="2" selected>高中</option>
<option value="3">大专</option>
</select>
</div>
<!-- 8.简介 -->
<div>
<label for="introduce">简介:</label>
<textarea name="intro" cols="20" rows="5" id="introduce"></textarea>
</div>
</fieldset>
<!-- 9.重置按钮 -->
<!--
前提:
1.前提一:type必须是reset类型(value值可以不写)
2.前提二: 所有的内容都必须在同一个表单中(form)
-->
<input type="reset">
<!-- 10.进行表单提交 -->
<input type="submit">
</form>
</body>
</html>