Input 类型:type = “email/url/number/range/date picker/search/color/tel”
手机端弹出字母键盘,电脑端无差别"><input type = "email" name = "email"> 手机端弹出字母键盘,电脑端无差别
<input type = "tel" name = "tel"> 手机端弹出数字键盘,电脑端无差别
<input type = "number" name = "number"> 手机端弹出数字键盘,电脑端右边多处两个按钮控制加减,只能输入参与运算的内容“+ - . 1 2 3 4 5 6 7 9 e”
data picker input类型:
date —— 选取 日, 月, 年
month —— 选取月,年
week —— 选取 周和年
time —— 选取时间(小时和分钟)
datetime —— 选取时间,日,月,年(utc时间)
datetime-local —— 选取时间,日,月, 年(本地时间)
使用方法一样 <input type = "date" name = "date" > 手机端显示的是 日期键盘
<input type = "range" name = "range" min = "最小值" max = "最大值">
<input type = "search" name = "search" >
<input type = "color" name = "color">弹出颜色选择
表单属性:
autocomplete/autofocus/multiple/placeholder/required
<form autocomplete = "on"(#自动完成功能,存下之前提交过的字段#)action = "****" ausofocous = "">
<input type = "text" name = "text" autofocus = "autofocus">(#不写autocomplete 默认开启存储 autofocus 光标自动确定该input#)
<input type = "email" name = "email" autocomplete = "off">(#关闭自动存储#)
<input type = "file" multiple = "muliple" / >(#muliple 是乘法,代表多个的意思,同时上传多个文件#)
ps. multiple 在类型为type的时候,也可以用,多个邮箱之间用 分号 隔开。 如果没有multiple ,email类型也可以传多个email,但是用了multiple 的 input,会传出一个数组到后台,而没有用的则会传出一整个字符串,难以操作。
<input type = "text" placeholder = "用户名" />(#提示输入用户名,开始输入时提示消失#)
ps. placeholder 适用于: text, search, url, tel, email, password。
<input type = "text" required = "required" /> (#required 规定必须在提交之前填写输入域(不能为空)#)
<input type = "submit">
</form>
链接属性
<link rel = "icon" href = "icon.gif" type = "image/gif" sizes = "16 * 16"> (#网页标签上面的图片,根据不同的分辨率改变size大小,改变清晰度#)
<base>标签的target属性
<base href = "#####" target = "_blank">(#让超链接是新键窗口打开#)
超链接<a>标签
<a meidia = "" rel = "" hreflang = "">
media = "" 表示对设备进行优化,handhelp 对手持设备进行支持,tv对电视设备进行支持
hreflan = "zh" 设置语言,这里设置语言是中午呢
rel = "external" 设置超链接的引用,这里超链接为外部链接
script标签
deger : 加载完脚本后并不执行,而是等到整个页面加载完之后再执行
async : 加载完脚本后立刻执行,不用等到整个页面都加载完,属于异步执行
<script async src = "url"></script>
<script deger src = "url"></script>