HTML5 <dt> 标签

定义和用法

<dt> 标签定义一个定义列表中的一个项目,以及 dialog 中的角色。

HTML 4.01 与 HTML5 之间的差异

HTML5 引入了 <dialog> 标签。在 dialog 中,<dt> 标签定义句子所属的角色。参见例子 2。

例子

例子 1

<dl>
  <dt>Coffee</dt>
  <dd>Black hot drink</dd>
  <dt>Milk</dt>
  <dd>White cold drink</dd>
</dl>

例子 2

<dialog>
  <dt>老师</dt>
  <dd>2+2 等于?</dd>
  <dt>学生</dt>
  <dd>4</dd>
  <dt>老师</dt>
  <dd>答对了!</dd>
</dialog>

属性

标准属性

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

如需完整的描述,请访 HTML5 中标准属性

事件属性

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

如需完整的描述,请访 HTML5 中事件属性

TIY 实例

定义列表
如何创建定义列表。

Copyright © 2009-2011 Web前端开发-Web前端工程师 | Web前端学习之路 版权所有