HTML 5 <body> 标签

定义和用法

body 元素定义文档的主体。其中包含文档的所有内容(比如文本、图像、颜色、图形等等)。

HTML 4.01 与 HTML 5 之间的差异

在 HTML 5 中,删除了所有 <body> 的特殊属性。而那些属性在 HTML 4.01 中是不被赞成使用的。

示例

<html>

  <head></head>

  <body>文档的内容 ......</body>

</html>

标准属性

class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title

事件属性

onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload