type属性值 | 描述 |
---|---|
text | 单行文本 |
password | 密码 |
radio | 单选 |
checkbox | 多选 |
bottom | 普通按钮-不推荐使用(与bottom标签功能类似) |
submit | 提交按钮 |
reset | 重置按钮 |
image | 图片形式提交按钮 |
file | 文件域 |
邮箱 | |
tel | 手机号 |
number | 数字 |
search | 搜索框 |
range | 自由拖动滑块 |
time | 时间 |
date | 日期 |
datetime | |
mouth | 月 |
week | 周 |
color | 颜色 |
例如:
<input type="text"> <input type="submit"> <input type="email"> <input type="url"> <input type="search"> <input type="file">
效果图
input属性
- outline:none ——> 去除点击效果(去除默认样式)
- 样式名:focus{可添加获取焦点后的样式}
- name ——> 自定义名称
- value ——> 默认文本
- size ——> 宽
- checked ——> 多选按钮(值为checked)中,默认选中
- maxlenght ——> 最多输入字符数
- lableb ——> 这是一个双标签,点击里面内容自动聚焦
eg:
<lable for="cheshi">正常文本内容</lable> <input id="cheshi" type="text">/* id与for里面内容一直 */