HTML中级教程 自定义列表

在HTML初级教程中我们教授了无序列表和有序列表,很不幸,很像Peter Cushing的博士Who,自定义列表很容易被忽略。可能是因为自定义列表需要比无序列表和有序列表更多的设置和似乎更少用。当遭遇一系列术语与解释的列表(比如术语表)时,自定义列表就会很有用了。

dl元素像ul元素和ol元素一样确立列表。不同的是,自定义列表用dt(definition term,定义术语)元素来代替li元素,其后跟随dd(definition description,定义描述)元素。

不局限于一个dt跟着一个dd,而是任意的。比如有很多同义词,就可能一个dt跟着许多dd。如果有一个有许多不同意义的词,就可能许多dd后只有一个dt。

div css xhtml xml Example Source Code Example Source Code [www.52css.com]
<h1>Some random glossary thing</h1>
<dl>
<dt>HTML</dt>
  <dd>Abbreviation for HyperText Markup Language - a language used to make web pages.</dd> <dt>Dog</dt>
  <dd>Any carnivorous animal belonging to the family Canidae.</dd>
  <dd>The domesticated sub-species of the family Canidae, Canis lupus familiaris.</dd>
<dt>Moo juice</dt>
<dt>Cat beer</dt>
<dt>Milk</dt>
  <dd>A white liquid produced by cows and used for human consumption.</dd>
</dl>
posted @ 2013-07-25 17:49  zengjs  阅读(885)  评论(0编辑  收藏  举报