表单
form标签 input标签
·
表单标签 |
---|
form | 表单外层容器 |
input | 搜集用户信息,控件的展示 |
type属性 | 含义 |
---|
text | 普通的文本输入框 |
password | 密码输入框 |
checkbox | 复选框 |
radio | 单选框 |
file | 上传文件 |
submit | 提交按钮 |
reset | 重置按钮 |
<form action="htpp://提交地址">
<input type="text" >
<input type="text" placeholder="请输入用户名" >
<input type="password" >
<input type="checkbox" checked>A
<input type="checkbox" >B
<input type="checkbox" >C
<input type="radio" name="xuanxiang">选项1
<input type="radio" name="xuanxiang">选项2
<input type="file" >
<input type="submit" >
<input type="reset" >
</form>
🐖:placeholder表单背景提示信息
textarea标签
多行文本框
select标签 option标签
下拉菜单
<textarea cols="30" rows="10"></textarea>
<select >
<option selected>选项1</option>
<option >选项2</option>
<option >选项3</option>
</select>
<select size="2" >
<option selected disabled>请选择</option>
<option >选项1</option>
<option >选项2</option>
<option >选项3</option>
</select>
<select multiple>
<option >选项1</option>
<option >选项2</option>
<option >选项3</option>
</select>
表单属性 | 含义 |
---|
cols | 文本列数 |
rows | 文本行数 |
selected | 设置为默认选项 |
disabled | 不可选择 |
size | 下拉菜单显示项数 |
multiple | 多选 |
lable标签
提升表单选择范围,辅助表单
<input type="radio" name="xuanze" id="first"><label for="first">选项一</label>
<input type="radio" name="xuanze" id="senconed"><label for="senconed">选项二</label>