Html5 杂项

1、meta 标签
<meta name="keywords" content="meta总结,html,meta属性,meta跳转"> 设置网页关键字,以便搜索引擎搜索
<meta name="description" content="这里是描述信息"> 设置网页的描述信息,搜索引擎根据关键字查询到后会在后面显示描述信息
<meta http-equiv="refresh" content="2;URL=http://www.baidu.com"> 两秒钟后刷新跳转至百度
<meta http-equiv="content-type" charset="UTF-8"> 设置网页编码格式
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> 设置网页兼容IE7

2、块级标签与内联标签
块级标签默认独占一行,如<div><p><h1>等
内联标签不占一行,根据其中的内容的长度来占位,如<span><strong>

3、input中的文件上传
<input type="file" name="uptofile">
在<form>中必须要加上 enctype="multipart/form-data" 属性

4、select
<select name="province" multiple="multiple" size="2"> mulitple:多选 size:select的高度
<optgroup label="甘肃省"> 分组名,这个不能选择
<option value="lanzhou">兰州</option>
<option value="tianshui">天水</option>
<option value="jiuquan">酒泉</option>
<option value="zhangye">张掖</option>
</optgroup>
</select>

5、label
<label for="name">姓名</label>
<input id="name" type="text">
label的for属性,与input的id属性一致时,点击label,则input自动获取焦点


6、fieldset
<fieldset>
<legend>请登陆</legend>
<input type="text">
</fieldset>
请登陆

猜你喜欢

转载自www.cnblogs.com/dangrui0725/p/9503198.html