HTML5 中的新增了一些有趣的新特性:
- 用于绘画的 canvas 元素
- 用于媒介回放的 video 和 audio 元素
- 对本地离线存储的更好的支持
- 新的特殊内容元素,比如 article、footer、header、nav、section
- 新的表单控件,比如 calendar、date、time、email、url、search
内容列表类型:
HTML5 中引入了很多的标记元素,根据内容类型的不同,这些元素被分成了7大类:
- 内联(Embedded)
- 流(Flow)
- 标题(Heading)
- 交互(Interactive)
- 元数据(Metadata)
- 短语(Phrasing)
- 区段(Sectioning)
内容类型:
1.元数据(Metadata):通常出现在页面的head中,设置页面其他部分的表现和行为 。
元素:<base>,<link>,<meta>,<noscript>,<script>,<style>,<title>。
2.内联(Embedded):在文档中添加其他类型的内容。
元素:<audio>,<video>,<canvas>,<iframe>,<img>,<math>,<object>,<svg>。
3.交互(Interactive):与用户交互的内容。
元素:<a> , <audio> , <video> , <button> , <details> , <embed> , <iframe> , <img> , <input> , <label> , <object> , <select> , <textarea>。
4.标题(Heading):定义段落标题。
元素:<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<hgroup>。
5.短语(Phrasing):文本和文本标记元素。
元素:<img>,<span>,<strong>,<label>,<br />,<small>,<sub>等。
6.流(Flow)内容:包含在文档正常流中的大多数HTML5元素。
7.区段(sectioning)内容:定义标题,内容,导航和页脚的范围。
元素:<article>,<aside>,<nav>,<section>
HTML5 中的页面结构
在编写 HTML5 文档时,你可能不需要其中的某些元素,具体取决于你的页面结构