超文本标记语言
类型 | 标签 |
---|---|
空元素 Void elements |
meta, base, link, br, wbr, hr, img, area, col, input,keygen, embed, param, source, track |
原生文本元素 Raw text elements |
script, style |
可回避的原生文本元素 escapable raw text elements |
textarea, title |
外来元素 Foreign elements |
从SVG或MathML中引用的元素 |
其他元素 Normal elements |
其他html元素 |
空元素(单标签)中间不能放内容,因为没有结束标签
类型 | 标签 |
---|---|
根元素 The root element |
html |
文档元数据 Document metadata |
head, title, base, meta, link, style |
节点 Sections | body, article, section, nav, aside, h1, h2, h3, h4, h5, h6, header, footer, address |
组合内容 Grouping content |
div, p, main, hr, pre, blockquote, ol, ul, li, dl, dt, dd, figure, figcaption |
文本级 Text-level semantics |
span, a, em, strong, q, cite, mark, i, b, u, s, sup, sub, big, small, var, code, samp, kbd, data, time, ruby, rb, rp, rt, rtc, bdi, bdo, dfn, br, wbr |
编辑 Edits | ins, del |
嵌入内容 Embedded content |
img, iframe, embed, object, param, vedio, audio, surce, track, map, area |
表格 Tabular data | table, caption, tr, th, td, thead, tbody, tfoot, col, colgroup |
表单 Forms | form, label, input, button, select, datalist, optgroup, option, textarea, keygen, output, progress, meter, fieldset, legend |
脚本 Scripting | script, noscript, template, canvas |
DOCTYPE是必须的,如果省略,浏览器可能会使用与标准不兼容的渲染模式。
<!-- html5 -->
<!DOCTYPE html>
<!-- xhtml 1.1 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!-- xhtml 1.0 strict -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- xhtml 1.0 transitional -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- html4.01 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- html4 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
类型 | 取值 |
---|---|
分类 | 无 |
元素上下文 | 根元素,没有父对象 |
内容模型 | head元素、body元素 |
属性 | 全局属性、manifest属性(指定描述了文档的缓存信息的URL) |
<!DOCTYPE html>
<html lang="en">
<!-- lang属性指定网页文档语言 -->
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html manifest="offline.manifest">
<head>
<meta charset="UTF-8">
<title>HTML5-manifest-sample demo</title>
<link rel="stylesheet" href="stylesheet/HTML5-manifest-sample.css"/>
</head>
<body>
<div id="content"></div>
<script src="javascript/HTML5-manifest-sample.js"></script>
</body>
</html>
CACHE MANIFEST
CACHE:
index.html
javascript/HTML5-manifest-sample.js
stylesheet/HTML5-manifest-sample.css
NETWORK:
*
FALLBACK:
//offline.html