一、常用标签1:页面结构标签
<html></html>:用于标记页面的开始和结束 —— 必需的\
<head></head>: 页面的头部 —— 必需的\
<body></body> :页面的主体 —— 必需的\
<title></title>:头部里的标题\
<link rel="" href="">:链接一个外部资源文件,例如图标文件、样式表文件等\
<meta charset="">:页面元数据(描述数据的数据)
二、常用标签2:表格
一般情况下,使用table元素实现批量的数据展示;偶尔可以使用它实现页面的特殊布局(例如水平和竖直同时居中)\
<table></table>:数据表\
<tr></tr>:表中的一行\
<td></td>:表中的一列\
<caption></caption>表格的标题\
<thead></thead>:表头\
<tbody></tbody>:表体\
<tfoot></tfoot>:表尾\
<th></th>:表头中的标题列\
三、常用标签3:列表
<ol></ol>:有序列表\
<ul></ul>:无序列表\
<li></li>:列表项\
<dl></dl>:定义列表\
<dt></dt>:定义一个类型\
<dd></dd>:定义该类型的详细说明
四、常用标签4:表单\
<form></form>:用于收集用户输入的表单\
<input type="text">:单行文本输入框\
<input type="password">:单行密码输入框\
<input type="radio">:单选按钮\
<input type="submit">:提交按钮\
<textarea rows="行数" col="列数"></textarea>:多行文本输入框
<input type="hidden" name="uid" value="1234">:隐藏字段(用户看不见,但能提交)\
<label for="某个输入框的ID"></label>:为指定的输入框配备一个便签\
<input type="checkbox">:复选按钮\
<select></select>:下拉菜单\
<option></option>:下拉菜单中的选项\
<input type="file">:文件上传域
五、HTML5新增的输入元素
<input type="date">:日期选择框\
<input type="month">:月份选择框\
<input type="week">:周选择框\
<input type="time">:时间选择框\
<input type="datetime-local">:本地格式的日期时间选择框\
<input type="color">:颜色选择框\
<input type="range">:范围选择框\
<input type="number">:数字输入框\
<input type="tel">:电话输入框\
<input type="email">:邮箱输入框\
<input type="url">:URL地址输入框\
<input type="search">:搜索输入框
六、常用标签5:页面嵌入标签
<iframe src="相对或绝对页面地址" width="" height=""></iframe>
七、语义化标签
<header></header>:头部\
<nav></nav >:导航\
<section></section>:一部分\
<aside></aside>:侧边栏\
<article></article>:文章/帖子\
<footer></footer>:尾部
标签名 | 含义和作用 | 常用属性 | 类型 |
---|---|---|---|
<b></b> | 文本加粗 | 行内 | |
<i></i> | 文本斜体 | 行内 | |
<u></u> | 文本添加下划线 | 行内 | |
<s></s> | 文本添加删除线 | 行内 | |
<sup></sup> | 上标字 | 行内 | |
<sub></sub> | 下标字 | 行内 | |
<br> | 换行 | —— | |
<pre></pre> | 保留源代码中的原始格式 | 块级 | |
<h1></h1> | 一号标题字 | 块级 | |
<h2></h2> | 二号标题字 | 块级 | |
<h3></h3> | 三号标题字 | 块级 | |
<h4></h4> | 四号标题字 | 块级 | |
<h5></h5> | 五号标题字 | 块级 | |
<h6></h6> | 六号标题字 | 块级 | |
<p></p> | 段落 | 块级 | |
<img> | 图片 | src="图片来源" | 行内块 |
<a></a> | 超链接 | href="x.html"href="//www.baidu.com"href="tel: 13501234567"href="javascript: console.log(123)"href="mailto: lwh@tedu.cn" | 行内 |
<base> | 指定当前页面所有的相对URL的基础值 | href="www.tedu.cn/" | 不可见 |
<html></html> | 标记页面的开始结束 | lang="zh-cn" | 块级 |
<head></head> | 页面的头部 | 不可见 | |
<body></body> | 页面的主体 | 块级 | |
<title></title> | 页面头部里的标题 | 不可见 | |
<link> | 页面头部里的图标 链接一个外部资源文件 | rel="icon"href="favicon.ico" | 不可见 |
<meta> | 元数据(页面内容字符集) | charset="utf-8" | 不可见 |
<table></table> | 表格 | border="1"align="left/center/right"width="300"height="100%"cellspacing="0" | 块级 |
<caption></caption> | 表格顶部的标题 | —— | |
<thead></thead> | 表格头部 | —— | |
<tbody></tbody> | 表格主体 | —— | |
<tfoot></tfoot> | 表格尾部 | —— | |
<tr></tr> | 表格中的一行 | —— | |
<th></th> | 表格头部中的一个头部列 | —— | |
<td></td> | 表格中的一个数据单元格 | align="left/center/right" valign="top/middle/bottom"rowspan="4"colspan="3" | —— |
<ol></ol> | 有序列表 | type="1/a/A/i/I" | 块级 |
<ul></ul> | 无序列表 | type="circle/disc/square" | 块级 |
<li></li> | 列表项 | 块级 | |
<dl></dl> | 定义列表 | 块级 | |
<dt></dt> | 定义列表中定义的类型 | 块级 | |
<dd></dd> | 定义列表定义的类型的详细描述 | 块级 | |
<form></form> | 表单 | action="/user/login"method="GET"enctype="请求数据的编码类型" | 不可见 |
<input type="text"> | 单行文本输入域 | disabled="true"readonly="true"name="要提交的数据的名称"value="用户输入的值"placeholder="占位符提示文字" | 行内块 |
<input type="password"> | 单行密码输入域 | disabled="true"readonly="true"name="要提交的数据的名称"value="用户输入的值"placeholder="占位符提示文字" | 行内块 |
<input type="radio"> | 单选框 | checked="true" | |
<input type="checkbox"> | 复选框 | checked="true" | |
<select></select> | 下拉菜单 | name=""size="1"multiple="true" | 行内块 |