The root element
<html></html>
html是html文件的根元素
<!DOCTYPE html>
<html>
<html>
Document metadata
<head></head>
<head> 元素表示文档元数据的集合[头]
<!DOCTYPE html>
<html>
<head>
</head>
<html
<title></title>
<!DOCTYPE html>
<html>
<head>
<title>First HTML</title>
</head>
</html>
<title> 元素代表文档的名字或标题。
<meta>
<meta> 元素提供文档的元信息,一般要加上
<!DOCTYPE html>
<html>
<head>
<title>First HTML</title>
<meta charset=utf-8>
</head>
</html>
Sections
<body>
浏览器窗口中显示的所有内容都在 <body> 元素中
<!DOCTYPE html>
<html>
<head>
<title>
First HTML
</title>
<meta charset=utf-8>
</head>
<body>
I'm Chinese
</body>
</html>
<h1> to <h6>
<h1>~<h6> 元素表示某一部分的标题,字体由大变小
<body>
<h1>I'm Chinese</h1>
<h2>我的故乡</h2>
我的故乡是温州,那是一个临海的城市。
</body>
<address>
<address> 代表联系信息,不仅仅是”地址“。
<address>
Rm 401 CKP West Wing<br>
玉泉 Camps<br>
浙江
</address>
Grouping content
<p>
<p> 元素代表一个段落。
<hr>
<hr> 元素代表一条水平分隔线,可以配置水平分割线的长度、宽度、颜色。
<hr width="50" align="left" size="10" color="purple">
<pre>
<pre> 元素用于定义预格式化的文本,被包围在 <pre> 元素中的文本通常会保留空格和换行符,常用来表示程序的源代码
html中会将多个空格保留为1个 pre保留原文
<blockquote>
<blockquote> 元素用于定义引用块。[一个大缩进]
<body>
<blockquote>
Hello World
</blockquote>
</body>
<ol>
<ol> 元素表示有序列表。
<body>
<ol>
<li>
红茶
</li>
<li>
绿茶
</li>
<li>
花茶
</li>
</ol>
</body>
<ol>产生的是带序号的有序列表,可以通过改变起始序号,改变整个序列
<body>
<ol start="-1">
<li>
红茶
</li>
<li>
绿茶
</li>
<li>
花茶
</li>
</ol>
</body>
<ul>
<ul> 元素表示无序列表。(可嵌套)
<body >
<ol>
<li>
红茶
</li>
<li>
绿茶
</li>
<li>
花茶
</li>
</ol>
</body>
<li>
<li> 元素表示有序列表 <ol> 和 无序列表 <ul> 的一项。
<dl>
<dt>
<dd>
<dl> 元素、 <dt> 元素、 <dd> 元素表示自定义列表。
<body >
<dl>
方糖
<dd>
方的糖,甜的
</dd>
<dd>
好吃的糖
</dd>
</dl>
</body>
Text-level semantics
<a>
<a> 元素用于定义超链接。
<a href="http://news.163.com" target="_blank">
网易新闻
</a><br>
点击后将进入网易新闻(target=“_blank" 加上后会打开一个新页面。
<em>
<em> 元素把文本定义为强调的内容。
<strong>
<strong> 元素把文本定义为语气更强的强调的内容。
<small>
<small> 元素呈现小号字体效果。
<s>
<s> 元素定义加删除线的文本。
<cite>
<cite> 元素通常表示它所包含的文本对某个参考文献的引用,比如书籍或者杂志的标题。按照惯例,引用的文本将以斜体显示。
<q>
<q> 元素定义短的引用。
<dfn>
<dfn> 元素定义一个定义项目。
<body >
<em>强调内容</em><br>
<strong>语气更强的强调内容</strong><br>
<small>元素呈小号字体</small><br>
<s>加删除线</s><br>
<cite>引用文本 斜体</cite><br>
<q>短语引用</q><br>
<dfn>定义一个项目</dfn><br>
</body>
<abbr>
<abbr> 元素表示简称或缩写。
<body >
<abbr title="中华人民共和国">PRC</abbr>
</body>
<code>
<code> 元素用于表示计算机源代码或者其他机器可以阅读的文本内容。
<var>
<var> 元素用于定义变量。可以将此标签与 <pre> 及 <code> 标签配合使用。
<body>
<p>Then he turned to the blackboard and picked up the chalk. After a few moment's thought, he wrote <var>E</var> = <var>m</var> <var>c</var><sup>2</sup>. The teacher looked pleased.</p>
</body>
<sup><sub>
上标和下标
<body>
a<sup>2</sup>b<sub>0</sub>
</body>
<samp>
<samp> 元素用于定义样本文本。
<kbd>
<kbd> 元素定义键盘文本。它表示文本是从键盘上键入的。
<i>
<i> 元素定义斜体。
<b>
<b> 元素定义粗体文件。
<u>
<u> 元素为文本添加下划线。
<mark>
<mark> 元素突出显示文本。
<body>
<samp>样本文本</samp><br>
<kdb>键盘输入的文本</kdb><br>
<i>斜体</i><br>
<b>粗体</b><br>
<u>为文本添加下划线</u><br>
<mark>突出显示文本</mark>
</body>
Edits
<ins>
<ins> 元素定义已经被插入文档中的文本。
<del>
<del> 元素定义文档中已被删除的文本。
Embedded content
<img>
<img> 元素定义图片。
<img src="1.jpg" width=100 height="100">
src后可跟文件夹中的图片,也可跟网络上的图片地址。
<map>
<area>
<body>
<img src="1.jpg" width=100 height="100" usemap="#map" ><br>
<map name ="map">
<area shape="rect" coords="0,0,50,50" href
="http://news.163.com" alt="news">
<area shape="circle" coords="75,75,25" href
="http://www.163.com" alt="home">
</map>
</body>
在一个名为1.jpg的图片上 左上角矩形和右下角⚪处有链接可点
<bdi> 和 <bdo>
<bdi> 元素允许您设置一段文本,使其脱离其父元素的文本方向设置。
<bdo> 元素可覆盖默认的文本方向。
<body>
<bdo dir="rtl">这是<bdi>干啥</bdi>的?</bdo><br>
</body>
<table>
<tbody>
<colspan>
<thead>
<tr>
<td>
<th>
制表
<body>
<table border="1">
<thead>
<tr>
<th>OS</th>
<th>Chinese</th>
<th>French</th>
</tr>
</thead>
<tbody>
<tr>
<td>IOS5</td>
<td>YES</td>
<td>YES</td>
</tr>
<tr>
<td colspan="3">Windows、OS</td>
</tr>
</tbody>
</table>
</body>
内容参考:CSDN博主「魏贺礼」https://blog.csdn.net/wozaixiaoximen/article/details/45157439