类型 | 标签 |
---|---|
根元素 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 |
类型 | 取值 |
---|---|
分类 | Sectioning root |
元素上下文 | html元素里的第二个元素 |
内容模型 | 流内容Flow content |
属性 |
全局属性 onafterprint、onhashchange、onmessage、 ononline、onpageshow、onstorage等行为属性 |
<!DOCTYPE HTML>
<html>
<head>
<title>Online or offline?</title>
<script>
function update(online) {
document.getElementById('status').textContent = online ? 'Online' : 'Offline';
}
</script>
</head>
<body ononline="update(true)"
onoffline="update(false)"
onload="update(navigator.onLine)">
<p>You are: <span id="status">(Unknown)</span></p>
</body>
</html>
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 可感知内容-Palpable content |
元素上下文 | 需要流内容的地方 |
内容模型 | 流内容,但是不能使header、footer和main三个标签。 |
属性 | 全局属性 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网页标题</title>
</head>
<body>
<header>
<h1>Little Green Guys With Guns</h1>
<nav>
<ul>
<li><a href="/games">Games</a>
<li><a href="/forum">Forum</a>
<li><a href="/download">Download</a>
</ul>
</nav>
<h2>Important News</h2>
<p>To play today's games you will need to update your client.</p>
<h2>Games</h2>
</header>
<p>You have three active games:</p>
</body>
</html>
类型 | 取值 | |
---|---|---|
分类 |
流内容-Flow content 可感知内容-Palpable content |
|
元素上下文 | 需要流内容的地方 | |
内容模型 | 流内容,但是不能使header、footer和main三个标签。 | 流内容,但是不能使header、footer和main三个标签。 |
属性 | 全局属性 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网页标题</title>
</head>
<body>
<header>some content</header>
<main>some content</main>
<footer>
<nav>
<p>
<a href="/credits.html">Credits</a> —
<a href="/tos.html">Terms of Service</a> —
<a href="/index.html">Blog Index</a>
</p>
</nav>
<p>Copyright © 2009 Gordon Freeman</p>
</footer>
</body>
</html>
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 节点内容-Sectioning content 可感知内容-Palpable content |
元素上下文 | 需要流内容的地方 |
内容模型 | 流内容,但是不能使用main元素 |
属性 | 全局属性 |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网页标题</title>
</head>
<body>
<header>some content</header>
<main>some content</main>
<footer>
<nav>
<p>
<a href="/credits.html">Credits</a> —
<a href="/tos.html">Terms of Service</a> —
<a href="/index.html">Blog Index</a>
</p>
</nav>
<p>Copyright © 2009 Gordon Freeman</p>
</footer>
</body>
</html>
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 节点内容-Sectioning content 可感知内容-Palpable content |
元素上下文 | 需要流内容的地方 |
内容模型 | 流内容,但是不能使用main元素 |
属性 | 全局属性 |
<header>
<h1>My wonderful blog</h1>
<p>My tagline</p>
</header>
<aside>
<nav>
<h1>My blogroll</h1>
<ul><li><a href="http://blog.example.com/">Example Blog</a></ul>
</nav>
<nav>other nav</nav>
</aside>
<aside>other aside</aside>
<article>
<h1>My last post</h1>
<p>This is my last post.</p>
<footer><p><a href="/last-post" rel=bookmark>Permalink</a></footer>
</article>
<article>other article</article>
<footer>
<nav>
<a href="/archives">Archives</a> —
<a href="/about">About me</a> —
<a href="/copyright">Copyright</a>
</nav>
</footer>
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 节点内容-Sectioning content 可感知内容-Palpable content |
元素上下文 | 需要流内容的地方 |
内容模型 | 流内容 |
属性 | 全局属性 |
<article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<h1 itemprop="headline">The Very First Rule of Life</h1>
<p>
<time itemprop="datePublished" datetime="2009-10-09">3 days ago</time>
</p>
<link itemprop="url" href="?comments=0">
</header>
<p>If there's a microphone anywhere near you, assume it's hot and sending whatever you're saying to the world. Seriously.</p>
<p>...</p>
<footer>
<a itemprop="discussionUrl" href="?comments=1">Show comments...</a>
</footer>
</article>
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 节点内容-Sectioning content 可感知内容-Palpable content |
元素上下文 | 需要流内容的地方 |
内容模型 | 流内容 |
属性 | 全局属性 |
<article class="book">
<header>
<h2>My Book</h2>
<p>A sample with not much content</p>
<p><small>Published by Dummy Publicorp Ltd.</small></p>
</header>
<section class="chapter">
<h3>My First Chapter</h3>
<p>This is the first of my chapters. It doesn't say much.</p>
<p>But it has two paragraphs!</p>
</section>
<section class="chapter">
<h3>It Continutes: The Second Chapter</h3>
<p>Bla dee bla, dee bla dee bla. Boom.</p>
</section>
<section class="appendix">
<h3>Appendix A: Overview of Examples</h3>
<p>These are demonstrations.</p>
</section>
<footer>footer content</footer>
</article>
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 可感知内容-Palpable content |
元素上下文 | 需要流内容的地方 |
内容模型 | 流内容,但是不能使header、footer、section、address等节点元素 |
属性 | 全局属性 |
<address>
<a href="../People/Raggett/">Dave Raggett</a>,
<a href="../People/Arnaud/">Arnaud Le Hors</a>,
contact persons for the <a href="Activity">W3C HTML Activity</a>
</address>
Dave Raggett,
Arnaud Le Hors,
contact persons for the W3C HTML Activity
类型 | 取值 |
---|---|
分类 |
流内容-Flow content 标题内容-Heading content 可感知内容-Palpable content |
元素上下文 | 需要短句内容的地方 |
内容模型 | 短句内容-Phrasing content |
属性 | 全局属性 |
{:.flexbox.vleft}
<h1>一号标题</h1>
<h2>二号标题</h2>
<h3>三号标题</h3>
<h4>四号标题</h4>
<h5>五号标题</h5>
<h6>六号标题</h6>