最高效的WEB程序员学习网站
SVG手册 HTML5手册
 

<dl>、<dt>和<dd>标记的用法


<dl>、<dt>、<dd>这三个html标记是一个组合,它们很很像<ul><li>这个标签组合,但<dl>、<dt>、<dd>通常是用来描述一些术语定义,比如附录里的词汇表,或用来显示key-value这样成对的键和值。

<dl>、<dt>、<dd>通常被称为定义性列表。


例一:一个术语对应一条解释或定义

<dl>
  <dt>Firefox</dt>
  <dd>A free, open source, cross-platform, graphical web browser
      developed by the Mozilla Corporation and hundreds of volunteers.</dd>

  <!-- other terms and definitions -->
</dl>


例二:多个术语对应一条解释或定义

<dl>
  <dt>Firefox</dt>
  <dt>Mozilla Firefox</dt>
  <dt>Fx</dt>
  <dd>A free, open source, cross-platform, graphical web browser
      developed by the Mozilla Corporation and hundreds of volunteers.</dd>

  <!-- other terms and definitions -->
</dl>


例二:一个术语对应多条解释或定义

<dl>
  <dt>Firefox</dt>
  <dd>A free, open source, cross-platform, graphical web browser
      developed by the Mozilla Corporation and hundreds of volunteers.</dd>
  <dd>The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox,
      is a mostly herbivorous mammal, slightly larger than a domestic cat
      (60 cm long).</dd>

  <!-- other terms and definitions -->
</dl>


例二:多术语和解释或定义

<dl>
    <dt>Name</dt>    
    <dd>Godzilla</dd>
    <dt>Born</dt>
    <dd>1952</dd>
    <dt>Birthplace</dt>
    <dd>Japan</dd>
    <dt>Color</dt>
    <dd>Green</dd>
</dl>