表单标签
1.form【表单】(链接用户和服务器,用户填数据,将表单发送给服务器)
user——>表单——>webserver(服务器) 【过程称为:请求(request)】
user<——表单<——webserver(服务器) 【过程称为:返回(reponse)】
<form.></form>
点我
<form。 action="网站"> <input type="text">(输入内容)【input:输入,接受用户输入数据】(搜索按钮) 百度一下 </form>
(输入内容) (搜索按钮) 百度一下
所有表单元素需放在form标签内
2.mothod
method:用来定义数据传递到服务器的方式
其属性如下:
get:https://网址【毫无安全性,适合轻量级,安全性不高的数据】
post:https://网址(数据不会再网址中显示)【安全性高】
3.账户和密码单
<form. action="#"> <di.v> <input type="text" value="cqie"> <input type="password" value="123456"> </div>
</form>
4.单选(ridio)
checked:标签的布尔属性【写上即有效】(只有删除标签才能去掉属性,checked=“false”无效)
<input type="radio" name="sex" checked> <input type="password" name="sex">
多选(checkbox)
<input type="checkbox" name="sex" value="男" id="man" checked> <input type="password" name="sex" value="女" id="womam">
5.文件域
input type=”file“ accept=<" .jpg, .png, .gif ">【限制输入文件类型】
表单按钮
分为:1.普通按钮 2.提交按钮 3.重置按钮
1.普通按钮 (验证码)【本身无任何功能,需添加js去实现功能】
<button type="button" value="普通按钮"></button>
2.提交按钮(必要)【登陆,注册,提交,发送,发布,保存】
<button type="submit" value="提交按钮"></button>
3.重置按钮(少用)
<button type="reset" value="重置按钮"></button>
下拉列表select(具有布尔属性)
<select. name="" id=""> <option value="cq">重庆</option> <option value="sh">上海</option> <option value="nm">牛马</option> </select>
重庆 上海 牛马
文本区域【可容纳无限数量文本】
<div.> <testarea> </testarea> </div>
require【必填项,具有布尔属性。只管有无内容,不管对错】
placeholder【对输入框进行注释,提醒用户输入内容】
readonly【只读】
disabled【表示该元素禁止使用】、
共用样式
button{
cursor:pointer;【改变光标变为手势】
}
input,button,select,{
ouline:none;【表单元素外壳边框去掉】
}
textaera{
resize:none;【用户调整文本域的功能去掉】
}
光标闪烁:聚焦状态【focus】
.myput{
}